04 August 2009

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

It seems like there are hundreds or thousands of people out there that have come across this little SharePoint sendemail bug. Beware this error message is a red herring! My suspicion is that through a series of unfortunate events around the sequencing / pipelining of workflow activities, the sendmail activity gets terminated prior to having a chance to become a fully dehydrated object. Postulations aside, here is the fix I used:

Observation 1 from 12's hive logs (C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\LOGS):
w3wp.exe (..) 0x.. Windows SharePoint Services, General, 8kh7, High, Cannot complete this action. Please try again.

Observation 2 from Workflow History:
Error, System Account, The e-mail message cannot be sent. Make sure the outgoing e-mail settings for the server are configured correctly.

So I fixed my <sendmailobject>_MethodInvoking by binding the sendmail activity's email fields (to:, cc:, body:, etc) to class variables and then assiging those variables within the method_invoking for the sendmail activity.

Before:
createPMApprovalEmail_MethodInvoking() {
createPMApprovalEmail.To = this.workflowProperties.OriginatorEmail;
..



After:
createPMApprovalEmail_MethodInvoking() {
this.createPMApprovalEmail_To1 = this.workflowProperties.OriginatorEmail;
..


Chris Buchanan wrote about this solution first, whose blog I stumbled upon by finding similar frustrations at Jason's blog.

No comments:

Post a Comment

firstly, thanks in advance for your comment - I don't get very many, so I'm sure to follow up if you leave me a way - secondly, come again.