Set sender name using SPUtility.SendEmail
SPWeb
oWeb = SPContext.Current.Web;
StringDictionary
headers = new StringDictionary();
string
strFromEmailID = "Name to display <"
+ fromEmailAddress + ">";
headers.Add("from", strFromEmailID);
headers.Add("to", toEmail);
headers.Add("subject", _subject);
headers.Add("content-type", "text/html");
System.Text.StringBuilder strMessage = new System.Text.StringBuilder();
strMessage.Append(_body);
SPUtility.SendEmail(web,
headers, strMessage.ToString());
Comments
Post a Comment