Send email from your MOSS Web Part

5 Sep

It’s easy to leverage the email server SharePoint is configured with already. This is the mail server used for alerts and notifications within the portal system.

You’ll need to add a reference to the Microsoft.SharePoint.Utilities namespace.

<span class="kwrd">using</span> Microsoft.SharePoint.Utilities;

Then just use the SendEmail method:

<p>SPUtility.SendEmail(SPContext.Current.Web, <span class="kwrd">false</span>, <span class="kwrd">false</span>, <span class="str">"to address"</span>, <span class="str">"subject line"</span>, <span class="str">"body"</span>);</p>
Tweet about this on TwitterShare on Google+Share on FacebookShare on RedditEmail this to someoneShare on LinkedInShare on StumbleUpon

Leave a Reply

Your email address will not be published. Required fields are marked *