Sending Emails in Sharepoint

Bekh picture Bekh · Jul 3, 2009 · Viewed 7.7k times · Source

I need to know what is the best practice for sending emails from my sharepoint webparts and/or customized features.

Should I just use the normal .Net classes to send email ? or is their a better way to do it through integration with an outlook server ?

Answer

Daniel Pollard picture Daniel Pollard · Jul 3, 2009

Easy way is to use the built in Utilities, this will then use the mail server setttings setup in central admin

using Microsoft.SharePoint.Utilities;
SPUtility.SendEmail(SPContext.Current.Web, false, false,
     "[email protected]", "subject",
     "body");