Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I am having a workflow for a document library. Whenever the workflow starts, it sends an emails with From: Documents. I want to change it to the current user. How is it possible?

share|improve this question

2 Answers 2

You can change the From field with Visual Studio. In the workflow design in Visual Studio, double-click the "send email" icon which needs the modified "from" field. Set the from property. Assuming my email method is called sendEmail, use the following code in the managed code:

private void sendEmail_MethodInvoking(object sender, EventArgs e)
{
   sendEmail.From = "someone@someplace.com";
}    
share|improve this answer

By default, you cannot change the 'From' address for a workflow. The from address populates by where the workflow is attached, so it will always appear to be sent by wherever the workflow is 'activated'. (a doc library, list, etc.)

There's a project on codeplex to add this functionality: http://spdactivities.codeplex.com/


If possible, try adding a signature to the body of the text in the email that will populate with the current user's name. The from field would remain what it currently is, but you'll enable whoever is recieving the email to see who actually populated it.

for example:

_This Message was populated from a SharePoint Workflow by user: [%Workflow Context:Current User%] _

share|improve this answer

Your Answer

 
discard

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.