Sending an email with an attachment from Workflow Foundation
SendEmailActivity in WF sucks… because you can’t send an email with attachments from it.
I want to be able to send an email from a SharePoint WorkFlow, using the SP Outbound Mail Service and adding some attachments to the message.
Use the .Net
MailMessage class (
System.Net.Mail) and a Code activity to send the email:
SharePoint’s smtp server must be configured in Central Admin, otherwise you will get a
Restart the SharePoint Timer Service to refresh it’s assembly cache if the workflow does not kick in
SPContext is not available in the Timer Job Context (under which the WF will run)
Get the source code here