locked
The error message in workflow history: The e-mail message cannot be sent

    Question

  • Hi All,

    i think many guys faced this problem.

    I am facing very small problem, My workflow i almost completed. but email functionality is not working.
    for each task assgined to user, need to send an email to say task assigned to him.
    but in my workflow history,after each task created, the error message shown like below.

    The e-mail message cannot be sent. Make sure the outgoing e-mail settings for the server are configured correctly

    i configured exchange server as smtp server and correct email address given in the central admin, out going email settings.
    nothing is wrong in configuration, but it still not sending emails. sending email is the highest priority in workflows.

    what is the problem,,

    please help me out.

    Praveen.

    Friday, September 07, 2007 6:23 AM

Answers

  • Hi Praveen,

     

    so, when a SendEmail activity is working, why dont you put a SendEmail act. after a CreateTask activity?

     

    I have a problem with a SendEmail activity, the funny thing is,

    it works in a Sequential workflow, but not in a State machine workflow.

    I also get "cannot be sent" in the Log History in the state machine WF.

    No error, even a hint in the log file of "Sharepoint Services Tracking"

     

    Bye

    Roland

     

    Wednesday, September 26, 2007 6:28 AM
  • I had a similar problem and solved it as follows:

    Problem:  I had a workflow that was supposed to pause, and thereafter send an email reminder.  Results: nothing.  Tried: everything.  Got the same error every time: The e-mail message cannot be sent. Make sure the outgoing e-mail setting for the server are configured correctly.

    Clues: SP was sending other emails, so I knew the email config was probably OK.

    Tests:  I moved the Pause Step after the email Step, and POW! it worked immedioately.  So, there problem seems related to the Pause Step.

    SOLUTION: Following the idea of Johan_0904, I returned the Pause Step to the front; and on the Send Email Step, I clicked "Add Else Conditional Branch".  I never used the "Add Else Conditional Branch".  But I did add the condition: "%Complete" "Greater Than" "-1".  This condition is always TRUE.  And the "Send Email" command worked thereafter.  QED.

    Tuesday, April 06, 2010 3:09 PM

All replies

  • I would test out whether you can send emails from anywhere else in the portal, or whether you're having problems sending emails from within workflow tasks only. If it's a portal-wide problem, try reposting this on the "administration setup and upgrade" forum.

     

    As for general advice, 1) double-check your SMTP settings, firewall settings, etc, 2) do an iisreset, as that is necessary for SharePoint to "pick up" the new outgoing email settings.

     

    Monday, September 10, 2007 10:14 PM
  • Hi PSeale,
               Thanks for your reply.
    yes, it is sending mails anywhere else in the portal other tham workflow.
    ther is no configuration issues, smtp server and wmail is fine.

    i checked everything. but, i didn't understand one thing.

    On workflow history page, For all the email error,
    Under User ID it is showing System Account(Sharepoint\system).

    what is this account, whio created this one?

    thanks.
    Praveen.

    Tuesday, September 11, 2007 1:24 PM
  • As for the System Account, that's something specific to your setup. It's different for everybody.

     

    As for checking outgoing emails, try isolating the problem--try sending an email to a hardcoded address (e.g., your email address) and see if that works. If it still doesn't work, then I'd investigate your email setup; if this is in production, you should have email admins who can tell you if they're throwing away or spam filtering your emails (both possible).

     

     

    Tuesday, September 11, 2007 2:32 PM
  • Hi PSeale,

              if a task assigned to user, i set in workflow properties, i setted the boolean SendEmailNotification to TRUE.
    so, it will send mail automatically to assigned user,but email functionality not working,

    Due to this my work was stopped, i.e not pushed to production, please help me out,

    this is my first priority,

    My workflow contains lot of SendMail activities, all are workflow fine, i am getting mails,

    thanks for ur quick reply.

    thanks
    Praveen.
    Tuesday, September 11, 2007 2:54 PM
  • The problem is about sendemail activity itself.. Pay attantion on its properties.. Don't leave them blank and insert appropriate values .. Especially "from" property..

     

    good luck..

    Wednesday, September 12, 2007 11:53 AM
  • Hi there,

    thanks for your reply,
    i am not talking about sendmail activity,
    un taskproperties when i set sendmailnotification to true, sharepoint automatically send mails to assigned users,

    send mail activity is working fine.

    thanks
    Praveen.

    Wednesday, September 12, 2007 12:21 PM
  • Hi Praveen,

     

    so, when a SendEmail activity is working, why dont you put a SendEmail act. after a CreateTask activity?

     

    I have a problem with a SendEmail activity, the funny thing is,

    it works in a Sequential workflow, but not in a State machine workflow.

    I also get "cannot be sent" in the Log History in the state machine WF.

    No error, even a hint in the log file of "Sharepoint Services Tracking"

     

    Bye

    Roland

     

    Wednesday, September 26, 2007 6:28 AM
  • Hi,

    thanks for the repty...

    but in some cases through code only i am sending mails. As you said, I want to send 4 mails i need to take 4 send mail activities. when task assigned to a preson, i need to send mail to assignee and some other mails to other persons at the same time.

    i wrote send mail logic and sending mails through c# code. but unfortunately some of the mails goes to spam/junk folder.

    thanks
    Praveen.
    Wednesday, September 26, 2007 10:42 AM
  • Dear Aykut,

     

    Thanks a lot for your advice. However i know that this thread is a bit old now , almost 6 months old.

     

    Please could you let me know how to get to the properties of the "send email" activity in the sharepoint designer workflow.

     

     

    I have a workflow defined in my team site . When i open up the team site in my sharepoint desinger and go to workflows tab and go into my workflow "wf2", i can see the following 3 files inside it.

     

    wf2.aspx

    wf2.xoml

    wf2.xoml.wfconfig.xml

     

     

    Is this where somewhere iam supposed to put the 'From' address? ( im unable to find it?)

     

    Please help. THanks a Lot.

    Wednesday, April 16, 2008 2:02 AM
  •  

    Hi,

     

    Can anyone help to provide a solution for this:

     

     

    How can i get to the properties of the "send mail" activity of the "sharepoint designer", so that i can hardcode the mandatory parameters such as the 'From'.

     

    From the sharepoint log files, i realize that the error message is: "message refused' by the external exchange server.

     

    THis probably must be due to not specifying the 'From' address in the 'send mail' activity(not sure why sharepoint is unable to pick it up automatically from whaterver's been setup in the outgoing properties of the mail settings of sharepoint). Somehow only the sharepoint alerts and other non-sharepoint-designer mails are getting through.

     

     

    I have a simple workflow defined in my team site . When i open up the team site in my sharepoint desinger and go to workflows tab and go into my workflow "wf2", i can see the following 3 files inside it.

     

    wf2.aspx

    wf2.xoml

    wf2.xoml.wfconfig.xml

     

     

    Is this where someway i can put the 'From' address?

     

    Thanks.

     

    Friday, April 18, 2008 9:33 AM
  • maheshkzm, did you ever recieve a response or solution to this? I am having the same exact issue whereby I have a simple Workflow created in Sharepoint Designer.  The workflow sends a hardcoded email whenever a new item is changed or created, but whenever the workflow executes I recieve the following error in the Workflow history:

     

    "The e-mail message cannot be sent. Make sure the outgoing e-mail setting for the server are configured correctly"

     

    Alerts work fine, as so do Workflow Task emails created from the Sharepoint interface.  Please let me know as I do not have direct access to the server and thereby cannot make use of the more robust workflows done in Visual Studio. 

     

    Regards,

     

    - Nestor

    Tuesday, May 20, 2008 1:16 PM
  • Nestor, Im yet to receive a solution to this "sharepoint designer based email" issue. Do let me know if you have it fixed. THanks.

     

     

     

    Wednesday, May 21, 2008 1:13 AM
  • I have the same problem as the OP in my workflow.  The error first occured when I added some code that copied data from the initiation form into the task form (which should be 100% unrelated).  I think the problem is, in my case, with a Task that automagically sends an email, not a SendEmail activity.  I will likely troubleshoot over the next few weeks.
    Tuesday, August 05, 2008 9:32 PM
  • New clues for my specific case:

    Basically, I have a custom composite activity that assigns an approval task with a custom InfoPath form, waits for task completion, and does something based on whether the asignee approves or rejects.  Said approval task is set to be sent via email (as well as showing up in a certain Task list, per usual).

    For this workflow, an HR-1 form is used as the Initiation form, the data of which is parsed and placed in an object called initForm.  The following method is where the custom composite activity's approval task's properties are created; this method is called by onWorkflowActivated1_Invoked(--):

    public void initialize_getLvXApproval(int X, GetApproval2 activity) 
        var taskProperties = new SPWorkflowTaskProperties(); 
        taskProperties.TaskType = 0; 
     
        // general 
        taskProperties.SendEmailNotification = true
        taskProperties.AssignedTo = workflowProperties.Originator; 
        taskProperties.ExtendedProperties["Title"] = "HR-1 to approve or deny"
     
    // ...

    #region offendingCode 
        // push Initiation data into task's ExtendedProperties (i.e. the approval form). 
        // NOTE: There's got to be a better way!  Geez.... 
        taskProperties.ExtendedProperties["RequestDate"] = initForm.RequestDate; 
        taskProperties.ExtendedProperties["vacatedby"] = initForm.vacatedby; 
        taskProperties.ExtendedProperties["Supervisor"] = initForm.Supervisor; 
        taskProperties.ExtendedProperties["SupervisorName"] = initForm.SupervisorName; 
        taskProperties.ExtendedProperties["SupervisorTitle"] = initForm.SupervisorTitle; 
        taskProperties.ExtendedProperties["Division"] = initForm.Division; 
        taskProperties.ExtendedProperties["Department"] = initForm.Department; 
        taskProperties.ExtendedProperties["DeptNumber"] = initForm.DeptNumber; 
        taskProperties.ExtendedProperties["Job_Title"] = initForm.Job_Title; 
    #endregion             
     
        activity.createTask_TaskProperties = taskProperties; 
     
    // ... 

    Oh, and initForm is an object generated by parsing workflowProperties.InitiationData.  When I comment out the offendingCode block, the approval forms (the forms for the Tasks) will display fine, they just won't have any data in their respective fields.  Why would copying data from the filled-out init form to the new task form cause an error telling me to check my email configuration settings?!
    Wednesday, August 06, 2008 1:55 PM
  • I hope there is a solution out there. I am also having this problem We have created a Sharepoint List and assigned a workflow to email someone. Simply as anything. It works fine on our test server but our production server can't send the emails. We get the same error everyone else is getting.
    Friday, August 08, 2008 4:48 PM
  • I am having the same problem.

    I downloaded the Sharepoint V1 VHD from Microsoft available at:
    http://www.microsoft.com/downloads/details.aspx?FamilyID=67f93dcb-ada8-4db5-a47b-df17e14b2c74&displaylang=en

    I've installed Visual Studio Pro 2008 using the default settings onto this image.
    http://msdn.microsoft.com/en-us/vs2008/products/cc268305.aspx

    I followed a video which explains how to programatically create a user task on Robert Shelton's blog.
    http://www.sheltonblog.com/archive/2007/10/29/how-to-video-creating-a-user-task-document-workflow-in.aspx
    (be sure to click on the hi-res link)

    I also have the Sharepoint 2007 SDK, WSS 3.0 SDK and VSTO installed.

    I read another blog somewhere and the blog suggested creating global properties and assigning values to those.  I'm going to try that.




    • Proposed as answer by BigExchangeFan Monday, January 31, 2011 8:39 PM
    Friday, August 08, 2008 11:28 PM
  • As many others, I had to use the one-liner:

    SPUtility.SendEmail(SPWeb Web, bool fAppendHtmlTag, bool fHtmlEncode, string to, string subject, string htmlbody)

    This seems to work consistently!  Hurrah!
    • Proposed as answer by Peter_D503 Wednesday, February 18, 2009 7:46 AM
    Monday, August 25, 2008 6:42 PM
  • Guys, I too encountered this problem and it bugged the hell out of me...but I found a solution. It appears that SPD has some sort of glitch when you create a Send Mail activity within the 1st branch of a workflow step. Here's how I fixed it:

    Modify your workflow logic to not send an email on te first branch of your step, if you like you can store the body of the email in a dynamic string in te first branch and then on the second branch jt do te Send Email action. It worked just fine for me after that. You can also, delete that workflow from your site( yes delete) and then  create a brand new workflow. I know its a dumb and redundant but hey...it works!
    • Proposed as answer by Mark Cascella Tuesday, April 06, 2010 2:57 PM
    Friday, November 07, 2008 2:49 AM
  • I too get this error - I followed "apollodude217" answer to get it working:

    SPUtility.SendEmail(workflowProperties.Web, truetrue"me@example.com""Approved""Approved"); 

    Are they going to fix the SendEmail shape? (Maybe this is fixed in latest hotfixes).
    Wednesday, February 18, 2009 7:45 AM
  • hi

    SPUtility.SendEmail(workflowProperties.Web, 
    truetrue"me@example.com""Approved""Approved");

    no this doesn't work for me

    Saurabh@cleardevelop.com
    Friday, February 20, 2009 1:25 PM
  • first you have to correct your outgoing email settings. then

    you can use this method to send emails.
    SPUtility.SendEmail (SPWeb, Boolean, Boolean, String, String, String)
    if you need to send

    multiple emails you have to use a loop and within that you

    have to set email addresses to the method and send mails in

    a loop.
    examples are available in
    http://www.sharepoint-amila.blogspot.com/
    Wednesday, March 04, 2009 8:00 PM
  • We were having the same issue. The problem was solved by adding <font> tags to the string builder for the email body.
    Monday, March 09, 2009 8:31 PM
  • I had a similar problem and solved it as follows:

    Problem:  I had a workflow that was supposed to pause, and thereafter send an email reminder.  Results: nothing.  Tried: everything.  Got the same error every time: The e-mail message cannot be sent. Make sure the outgoing e-mail setting for the server are configured correctly.

    Clues: SP was sending other emails, so I knew the email config was probably OK.

    Tests:  I moved the Pause Step after the email Step, and POW! it worked immedioately.  So, there problem seems related to the Pause Step.

    SOLUTION: Following the idea of Johan_0904, I returned the Pause Step to the front; and on the Send Email Step, I clicked "Add Else Conditional Branch".  I never used the "Add Else Conditional Branch".  But I did add the condition: "%Complete" "Greater Than" "-1".  This condition is always TRUE.  And the "Send Email" command worked thereafter.  QED.

    Tuesday, April 06, 2010 3:09 PM
  • There is a solution called Enterprise Enabler, it uses AppComms to send metadata between applications as well as security tokens in real-time, which may have a great deal of value here.

    It monitors changes in the state of the data then migrates, transforms and delivers data to its destination application based upon triggers you define, without the need for custom coding.

    • Edited by Mike Walsh FIN Monday, January 31, 2011 8:52 PM question removed
    Monday, January 31, 2011 8:45 PM