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
From address:[email protected]
To address:[email protected]
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("to", "[email protected]");
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(" Make sure you have completed the survey! ");
SPUtility.SendEmail(oSPWeb, headers, strMessage.ToString());
}
}

Leon DPosted Aug 2, 2017, 9:15 PM
GowthamPosted Aug 2, 2017, 11:52 AM
GowthamPosted Aug 2, 2017, 11:51 AM
Gokhul VarmanPosted Aug 2, 2017, 8:44 AM
Sundaram SubramanianPosted Aug 2, 2017, 8:21 AM