Wednesday, November 11, 2009

SharePoint Workflow : Get From Email Address Configured in Central Admin

Scenario: I want to send email from workflow SendEmail activity. How to get From email address configured in central administration for my sharepoint application.

Note: For every sharepoint application, we can configure out-going email address information in central admin. This can be done in following steps:
a. Go to central admin site -> Application Management
b. Under "SharePoint Web Application Management" section, check for the link "Web application outgoing e-mail settings" and click on it.
c. Select the Web Application for which you want to set the out going email informatino.
d. Fill the following fields:
  • Outbound SMTP server:

  • From address:

  • Reply-to address:

  • Character set:

Approach:
In the SendEmail activity execute code, you write following instruction to get email set in above "From address:" field:

workflowProperties.Site.WebApplication.OutboundMailSenderAddress

No comments: