SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to create a sequential workflow using VS. I'm needing to loop through all the items in a list and send an email if one of the columns equals a specific status.

I have not found any good tutorials / documentation on sending emails from a VS workflow. Has anyone done this successfully? Any help is appreciated!

using: sharepoint 2010, visual studio 2010


share|improve this question
up vote 2 down vote accepted

There is a sendEmail activity that you can drop onto the designer. It is under SharePoint Workflow group.

You should be able to add the loop, the if check, and the send email activity to the designer and just set the fields as needed.

MSDN - SendEmail Activity Members

SendEmail Activity Tutorial on C# Corner

share|improve this answer
I've been spending so much time doing event receivers I had completely forgotten about that. I added a couple links to your answer so as to give ironman99 an example. – Robert Kaucher Sep 21 '12 at 18:16

Use SPUtility.SendEmail

For example you might call it like this:

using System.Collections.Specialized;
using Microsoft.SharePoint.Utilities;

//Code defining class/WF methods, etc.

            //Build the headers.
            StringDictionary headers = new StringDictionary(); 
            headers.Add("content-type", "text/html");
            headers.Add("subject", "subject");
            headers.Add("from", "");
            headers.Add("to", "");
            SPUtility.SendEmail(item.ParentList.ParentWeb, headers, body.ToString());
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.