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.
1 |
<span class="kwrd">using</span> Microsoft.SharePoint.Utilities; |
Then just use the SendEmail method:
1 |
<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> |