SharePoint Document Workflow "How to" – Sending an email with SharePoint 2007 (MOSS)

As a part of the series that I am blogging on the “How To’s” of Document Workflow in SharePoint 2007 (MOSS), here’s a tip on how to send an email from your workflow using SharePoint Designer.  This is a long how to post, so my suggestion is to check out the recorded web cast first (see link below).  It takes less time to show you how to do it than it does to write up the steps.  After you’ve seen it done, the steps will be valuable to help you do it on your SharePoint site.

Here are the links to the existing blog entries and web cast recordings.

  • Click here to find all of the SharePoint/MOSS 2007 blog entries from my team
  • Click here to see my recorded web cast on Building Document Workflow’s in MOSS 2007.
  • Click here to see the blog entry: How to enable the portal to receive external emails
  • Click here to to see the blog entry: How to extract an email address from an email sent to your Document Library for Workflow

In the entry labeled (above link) “How to extract an email address from an email sent to your Document Library for Workflow.”  I gave a detailed explanation of how to extract an email address from a document stored in a document library.  In this example, I will show how to use that email address (or a static email address) to send an email to a Person, Distribution Group, or dynamically based on the email address of the person who sent the document to the document library. 

My scenario, in case you have not read the earlier entries, is a resume processing workflow, in which people can email their resumes to some company ( and the workflow would run based on a new resume showing up in the document library.  This workflow step could be modified to ask the user for an email address to send to “using the Initiation button” (not shown here) or it could be “hard-coded” to send the email (with the attached document link) to a person or Distribution Link.

This demonstration presumes that you have access to SharePoint Designer.  If you do not, you can download an evaluation copy (see this article).

As a part of my resume processing scenario, I am sending an “Automated” email response to the applicant who sent their resume into our Job Site email address, using the email address attached to their resume in the document library and extracted and broken up into two parts (see my earlier article for why I broke the email up into two parts) .

Open SharePoint Designer to the site where the document library (associated with this workflow) exists.  Use the “Open Site” menu from the File Menu and put in the URL of your SharePoint Team Site, or wherever you document library exists.

  • Open your existing workflow, or create a new one.
  • Give the workflow a name (assuming that you’ve started a new Workflow)
  • Decide if you want the workflow to Manually, Automatically, or whenever an item is changed.

    • My suggestion is “Manually” while in development at the minimum.  This will keep you from having to continuously upload new documents to test the workflow.  You can upload one “test document” and keep using it, by manually starting the workflow on that document.
    • If you want “Automatic” starting of the workflow, turn that on after you are done testing/building, if you’d like, but if you are building this workflow on an “already existing” document library, you don’t want your workflow to inadvertently run while you are building it, should someone put a file in the folder.
    • Be careful of the “Automatically Start….an item has changed” option, as this has some unintended consequences, which I will explain in a subsequent blog entry.

  • Hit the “Next Button” (Bottom Right)
  • Give the this step a name, like “Send an Automated Email Response”
  • The next thing that we need to do is to setup the “Conditions” and the “Actions”

    • In this case, we won’t have a condition, because we want to always send an Automated email to the person who submits a resume.  I will talk more about conditions in a future blog entry, but if they are relatively simple to understand. 

Skip this step if you want to hard code an email address

    • First we need to get the email address from the SharePoint Document List, which as I’ve said before has been broken into two parts.  See this blog entry to understand why: How to extract an email address from an email sent to your Document Library for Workflow

      • In the article, I explained that you have to separate the email into 2 pieces to get past a SharePoint “issue” when dealing with email address and workflow.
      • So, we need to recombine the email address, into a normal email address, like:
      • We will use the “Build Dynamic String” Action to do this.

        • Choose the Action from the action menu
        • Set the Variable name to something that you will remember, like “Applicant Email Address”. 


        • Click on the “dynamic string” link and recombine (concatenate) the email address back into one string, which will be stored in the workflow variable that you created (“Applicant Email Address” in my case).
        • When you click on it, you get a “String Builder” form like this one:

      • Hit the “Add Lookup” button (Bottom Left) to add the two SharePoint Custom Columns that we created, when we broke the email into two pieces (again, see the earlier post link above for details)

        • When you hit the “Add Lookup” button, you get the “Define Workflow Lookup” form

          • Select “Current Item” as the source, which refers to the SharePoint list that the workflow is attached to (“Incoming Resume” document library in my case)
          • Then select the variable that holds the first part of the email address as the field ( “WFV Email Address Part before @ Symbol”, in my case.)
          • Hit the OK button to add that field
          • Now, without adding any spaces, do the same thing and add the second part of the email address, which in my case will be called “WFV Email Address Part from the @ Symbol on,” which by the way, if you followed my suggestions on how to extract the email address will contain the “@” symbol in the email address and everything to the right of the @ symbol.

Your screen should look like this:


    • Hit the OK button
    • Next we add the “Send an Email” action. 

    • Select the this message link
    • Now you should have the “Define E-Mail Message” form open
    • Hit the “Address book” button on the “To” line.  BTW, if you wanted to hard code an email address, just type in in here and skip the next step.

    • Now, in the “Select Users” box, you can either select an:

      • Individual user
      • Email Distribution List
      • Multiple users (Hold down your CTRL key as you select each user)
      • or, all of the above

    • In our case, we are going to use the the “Workflow lookup” option to select our user from the Workflow variable “Applicant Email address” that we defined above.

    • Select “Workflow Lookup” and then hit the “Add >>” button (on the right) and your screen will now look like this:

    • Select “Workflow Data” as the “Source”.  This will allow us to select the field that we built using the Build Dynamic String action (earlier).
    • Now, select the “Variable: Applicant Email Address” and hit the OK button to close the “Define Workflow Lookup”

  • Hit OK again, to close the “Select Users” Form

Your screen should look like this:

  • Now you can put in a message in the “Subject” Box
  • Put a message in the “Body” of the email

    • Note: If you wanted to send the link for the document (which in our scenario wouldn’t make sense, because it would be a link to the internal portal) you would follow these steps:

      • Hit the “Add Lookup to Body” button
      • Choose “Current Item” as the Source
      • Choose “Encoded Absolute URL” as the field
      • Then wrap the whole thing in an HTML Link tag, so that it looks like this:

My screen looks like this (assuming that you do not want to include the document link):

  • Hit the OK button

  • If you want, you can Log the action, by using the “Log to Workflow history action” and enter a simple message, like “Send automated email response.”

  • Click the “Check Workflow” button (button left), to make sure that you’ve made no mistakes.

  • Click the “Finish Button” (bottom right) to have the workflow attached to your SharePoint list (Document Library in my case)

  • Go back to your SharePoint Site and to your SharePoint List that has the workflow attached to it

  • Make sure that you have a document with an email address associated with it

  • Click on the document, and pull down it’s “actions” menu.

  • Hit the “Workflow” Action

  • Select your workflow (Click on it)

  • Hit the Start Button (You wont get this page, unless you chose “Allow Manual Start of Workflow (earlier step)”

  • If everything worked, you should get see a “Workflow Completed” column on your SharePoint List and an Email should’ve been sent.


It took an over an hour to write this up with the screen shots and all, so now I am going to take a nap! 🙂


~ Robert Shelton

Comments (32)

  1. zullu says:


    I am working on MOSS 2007 with InfoPath 2003.

    I have a workflow where a Infopath form is submitted by a user in the Form Library. Upon submission I am trying to send a mail to his manager. The mail needs to have the link of the form which has been submitted.

    I can see the link when I hover my mouse on the form (which looks like:


    How do I dynamically capture this link in the workflow to send it in the email content.

    There is something known as "Absolute URL".

    But not sure how to make use of it.

    Any help !!!



  2. Jackie Kearney says:

    Hi All,

    Do you know if instead of adding a link to the document, you can attach the document to the email you are sending out?


  3. Ravi says:

    Now suppose the resume is added to the library and instead of sending out a plain response I want to send back some attachments back to the candidate.

    Based on the department the resume is addressed to I want to send the attachment. For instance if the job application is for the IT department I want Sharepoint to send back documents related to IT department.

  4. zullu says:

    Hi Robert,

    You are logging the workflow steps in the above workflow in a history log.

    Any idea of where are these getting logged.

    Where do I see these entries getting logged, which file? which location?

    this is getting too messy with me.

    Please respond,



  5. Clayton says:

    Zullu, the workflow history is logged in the Workflow Status page.  You there by clicking on the hyperlinked status (e.g. "Completed") beneath your new workflow column.  When you click on that link, it takes you to the workflow status page for the current or most recent worfklow.  On that page, you see all tasks assigned during the workflow, the task status, and the workflow history log at the bottom with every step that was logged.  Then, there should also be a link to View Workflow History Reports, which is where you will see that all the info is logged to an XML file that can be rendered in Excel or other apps.

  6. zullu says:

    Thanks Clayton,

    I appreciate your patience of going thru my problem.

    Yes, I can see that when I click on the "Completed" link I am taken to the Workflow History page. But even though my Workflow has an unconditional step to log the value of a variable and also log a text "Mail Sent", I can’t see any entries appearing in this history.

    Even though the workflow status says "completed".

    Any idea about this.

    Thanks again.


  7. zullu says:


    Am eagerly waiting for you to respond back.

    Please Help!!

    I am trying to look for the History log but there seems to be no entries getting logged.

    Actually the problem is that the workflow is getting completed, but there is no Email being received by the recepient.

    I am getting frustated now.

    Can you throw some light on this.

    I have viewed your webcast for more than 15 times now to ensure that I have doing the things correctly ( stupid I am :-))

    But no worries !!

    I need to get this working.

    Thanks !!!


  8. PubSec says:


    I am guessing that you have not stripped off the HTML "Mailto:" tag in the senders email.  Did your look at my posting on how to do this:  As I explain in the blog posting, SharePoint actually puts an HTML tag around the persons email, which makes it your responsibility to strip that HTML BEFORE you can send the email.

    ~ Robert Shelton

  9. zullu says:

    Thanks Robert,

    For your precious time. As I told you I have watched ur webcasts several times, so I just wouldn’t miss that email stripping stuff.

    But the great news is that I have got this email working now!!!

    Yes! not exactly sure what I did, but I tried to debug from the scratch, resetting every options and finally made it.

    I guess there was something to do with my app pool or the exchange server settings.

    But thanks to you, anyways.

    Your webcasts have been a really helpful resources to me.

    Thanks again,


  10. Vicky says:

    Hi, I just have a simple workflow setup to send email to a person if got selected from the form in a list.  The workflow runs successfuly and complete, but Email never got sent.  I tested by sending email to myself, but I never receive the email. Do you have any idea?

  11. Jimmy says:

    This post is very helpful! Thanks so much. I have a quick question. Is there a way to set the e-mail variable such that an e-mail from the workflow is sent to the person who is currently logged in.

  12. WL says:

    Hello, I’m having trouble getting my workflows to "Complete" using a "wait for" action/query that is set-up to recognize a change to a drop-down field/item in order to send an email notification to a specific user advising of the change (without sending an email everytime the user makes a change to a list record).  Do you know how I can close/stop a workflow using the "wait for" query?  Also, is there any way for a workflow to recognize the first time a change is made to a drop-down field (for example, from No to Yes) and not every time a record is updated (and inadvertenly causes the a query of If X equals Yes then) to result in a positive result and a subsequent email notification?

  13. jdb_1715 says:

    It appears that starting a workflow from an email has stopped working in MOSS SP1. Has anyone else experienced this? Any workaround?

  14. SFMOSS says:

    In one response I read the suggestion of providing the document rather than a link to it in a WF generated email… That however sidestepped the question of how do you link to the item. I have a List which needs to generate a link to a newly created item (not just the attached file). I have tried all of the URL options to no avail… the path generated does not work.

    Any help appreciated.

  15. bob says:

    This works if the workflow is triggered manually.  Have you had success firing an email automatically when a new email message is received?

  16. Dhanyatha says:


    I have a document library. How do I link to title such that I dont have

    to display the file name and can click on title to edit the entry.

  17. caschaef says:

    Does anyone know if you can send an email to an email enabled document library instead of a person, distribution group, etc. using a workflow?

  18. marc says:

    Hi yall. within HP we are trying to implement a new MOSS workflow to facilitate my team’s publishing process. never having created workflows or data collection forms before, we charted into new waters cautiously. But, Within two weeks we have a functional concept & I hope our team can start using this soon instead of the 40/50 email per day we each get. SPD ROCKS!!

    RESPECT to Stephen Howard !!! With his help I have demoed the concept to our team & we plan to begin testing a new solution soon.

    I’ve hit a small snag. Hoping the gurus can point me in the right direction… Our workflow triggers emails at each step with its <BODY> stored in a variable. Doing the look-up’s within the initial step allows us to implement new templates in in 1 place & will capture only the initial values. How can we reuse the email templates with all the updated information ?

    TRAIL 1

    > look-up <MSG> inside <BODY> on the first step

    RESULT = initial <MSG> in all emails

    > TRAIL 2


    RESULT = Success, sort of…

    <DUE DATE><STATUS> look-ups in <BODY> not updated 🙁

    As we update the email templates it would be imposable to replace the HTML in every send email step & re-do the look-ups. I guess im trying to store the look-up inside my template NOT the value each look-up generates so that I can reuse them with all the current info. Can this be done or should be going a diffrent route ?

    Please link me back

    m  | a | r | c | . | b | u | l | b | u | l | I | a | n | @ | h | p | . | c | o | m

  19. Jason says:

    For some reason when I use a distribution group in the To field, the email is never sent. Is there a bug sending to DG’s?

  20. SPOLLACK says:

    Ok, maybe I am really slow…. I am using the AbsenseVacation Template from MS. I CANNOT for the life of me get it to send email when a user submits a vacation request.

    I have it setup in the setup.xoml, for the ones that do not require approval, the actions are: set Status to Approved. then EMAIL the person who created it.

    No email, no error no nothing. Am I missing something?

  21. Kim says:

    We have a SharePoint list that tracks corrective actions.  An action initially gets assigned to the employee’s supervisor (Field name – "Supervisor").  That supervisor may want to "reassign" the concern to another employee.  We are using Active Directory to allow the users to choose the name.  Supervisor would populate the "Reassigned To" field.

    I am new to SPD, and as such, have created 2 workflows for the same list.

    The first is launched whenever a new item is created, and an email is sent to the supervisor indicating that there is something for him to review (with a link to the item).

    The 2nd workflow is set to automatically start whenever an item is changed.

    I need to be able to have the workflow email the person who is entered into the "Reassigned To" field, as well as any future time that field is changed (i.e. The reassigned person, may once again, want to reassign to someone else".

    Right now, the first workflow works fine.  The 2nd workflow keeps sending emails out whenever an item gets updated/changed – not just the "Reassigned to field"

    Can someone put me on the right track.  Appreciate your help.

  22. Darlene says:

    I understand the process above – and I have it working……..but HOW do I automate this process?? If I select Auto when an item is created – then the workflow only works when an item is created from the new button within the library. I need the workflow to auto start every time an email is received into the library (and yes the library is correctly receiving emails). Help – thanks!

  23. Zarana says:

    I loved your answer. this worked perfectly fine for my workflow. Thanks a lot for sharing this..

  24. Vahid says:

    I want to send an Email with an attachment

  25. Vahid says:

    Please Help I Want Have an Procedure (Work flow) that when a file upload to a workspace file can send to many email .


  26. Y says:

    As you know, the From line come from the email address the system adminstrator sets for the farm.  We can't figure out how to change this or workaround this for a web application or, better, a site collection.  

    Scenario:  We want employees to nominate each other for kudos.  The nominator would fill out a form with the nominee name, etc.  We'd like the email kudo (we put in a dynamically generated card) to come directly from the nominator or from a set address like  Is any of this possible?

  27. Ren says:

    Thanks so much for thr info provided on this page! Convert video to mp4

  28. Diego Queiroz says:

    Hi guys.

    Im having a problem when sending mail from a list to other list that is configured to receive emails.

    The workflow triggers but no email is received.

    I know thet the email was sent cause when i put my personal email on cc i get the message on it.

    can u help?

  29. sai vara prasada says:

    how to add directory path in workflow email content.

    hi sir,

    i just want to know how to add a directory path (ex: [%Folderpath%] ) in email body content of workflow created.

    After recieving the email i am getting the body content with directory path as shown below but the path is repeated , please do the needful so that the path should not be repeated as shown below,

    Dear Sai Vara Prasada Rao, Your Shared FolderAudit access review is now overdue for: – \DKHELC05Fin_ArchiveFinland "> \DKHELC05Fin_ArchiveFinland Many

    2. One more question if i want to add field name in subject line of email ,then how to do it.

    kindly help me out




  30. popiey says:

    i commmention toiu sennnf hhsf have been good to me as an individual. thanks for your help my dears………………………

  31. pilay says:

    i as pilay, i love to play google and i know and thank you for letting me do my own thing (thing that i like so much, playing). guys to me you such an inspiration love you guys you're every thing, every help to todays youth like you are to me. i cant even wait to go back to my vilage and tell everyone and every youth there about you guys love you moreeee..