I was working on sent email using server object model.
The code runs perfectly but I am missing something to configure.Also I configured smtp server in local host but I can't relate anything.
On out going email settings:
Outbound SMTP server:WIN-LP2NAII0NV
codes were tried
using (SPSite oSPSite = new SPSite("http://win-l9p2naii0nv:10001/")) //Site collection URL
{
using (SPWeb oSPWeb = oSPSite.OpenWeb()) //Subsite URL
{
StringDictionary headers = new StringDictionary();
headers.Add("subject", "Welcome to the SharePoint");
headers.Add("fAppendHtmlTag","True"); //To enable HTML format
System.Text.StringBuilder strMessage = new System.Text.StringBuilder();
strMessage.Append("Message from CEO:");
strMessage.Append("<span style='color:red;'> Make sure you have completed the survey! </span>");
SPUtility.SendEmail(oSPWeb, headers, strMessage.ToString());
}
}