kyron35 (1) [Avatar] Offline
#1
Hi,

I have checked and don't see any errata on this or another topic in here with this same issue, so I'm hoping someone checks these forums and can offer some help here. I was walking through step by step building and deploying the sequential workflow as outlined in 8.2 and I got everything built successfully and deployed. I created a custom list exactly as shown in figure 8.14 - Title, Dormitory Name (choice), Room Number (number), Work Category (choice), Status (choice), Assigned To (group/people picker) and Notes (multiple lines of text).

I tried creating an item to get a feel for how the work flows behave and can't get the e-mail to send out. I know my farm is configured to send e-mails (a reusable workflow I have created previously works, as does notifications on new items), but if I check the workflow history I get the following item logged of type Error: "The e-mail message cannot be sent. Make sure the e-mail has a valid recipient."

I checked my typed code versus the downloaded source code and they are identical, so there isn't a typo there. Consulting google took me to a few different pages where people had similar issues

http://social.msdn.microsoft.com/Forums/sharepoint/en-US/6e848a25-019d-4220-aff6-c535da933e0f/the-error-message-in-workflow-history-the-email-message-cannot-be-sent
and
http://sharepoint.stackexchange.com/questions/10863/what-causes-the-e-mail-message-cannot-be-sent-error-when-using-a-retention-po

I even modified my wss_content database as suggested in the stackexchange link to ensure the system account had an address (yes, the error states recipient but both pages state to make sure their is a valid TO and FROM address or else it will fail) that was valid but I still get the same error continuously. Does anyone know what may be causing this error or have any help to offer?

edit:

Just to make this clearer and try and add all relevant info, when creating the "Assigned To" column for the SharePoint List, I chose People or Group, no multiple selection, selection of people only, choose from all users, and the show field drop down, I chose "Name". Could that be the issue?

For reference, here is the e-mail handler:

private void sendEmailtoAssignee_MethodInvoking(object sender, EventArgs e)
{
SPListItem wfItem = onWorkflowActivated1.WorkflowProperties.Item;
SPFieldUser assignedTo = (SPFieldUser)wfItem.Fields["Assigned To"];

SPFieldUserValue user = (SPFieldUserValue)assignedTo.GetFieldValue(
wfItem["Assigned To"].ToString());
string assigneeEmail = user.User.Email;

sendEmailtoAssignee.To = assigneeEmail;
sendEmailtoAssignee.Subject = "New work order has been created.";
sendEmailtoAssignee.Body = "Work order number " +
onWorkflowActivated1.WorkflowProperties.Item.ID + " has just been created and assigned to you.";
}

Message was edited by:
kyron35