C#: SharePoint 2013 - Custom SharePoint Designer Workflow Activity (Send E-mail)

Updated on 3/6/2015

The original purpose of this SharePoint workflow activity was to send an e-mail outside of the SharePoint code. The out-of-the-box SharePoint send e-mail activity will do an active directory lookup for a user and return an e-mail address. This poses a problem if the OOTB send email activity is given an email address that matches the username of someone else in active directory.

For example

Using the OOTB send e-mail workflow activity to send an e-mail to ajohnson@abc.com.

If active directory contains a user for ajohnson, and the e-mail address property in AD for ajohnson is amyjo@abc.com, the e-mail will be sent to amyjo@abc.com. This custom activity prevents this active directory lookup, and an e-mail will be sent to ajohnson@abc.com.

This workflow activity is based on one of the activities found in the found in Useful Sharepoint Designer Custom Workflow Activities (https://spdactivities.codeplex.com/).

Screen shot of activity configuration in SharePoint designer



Configure the outgoing e-mail settings for the web application where the activity will be deployed.

Add-SPSolution c:\CustomSendMailWorkflowActivity.wsp
Install-SPSolution CustomSendMailWorkflowActivity.wsp -GACDeployment -Force


UnInstall-SPSolution CustomSendMailWorkflowActivity.wsp
Remove-SPSolution CustomSendMailWorkflowActivity.wsp


CustomSendMailWorkflowActivity.zip (213.19 kB)