Calling Method:
emailFrom you can give any emailID
SendEmail(subject, body, true, champions, string.Empty, string.Empty, SPContext.Current.Site.RootWeb, emailFrom);
Method:
public static void SendEmail(string subject, string body, bool isBodyHtml, string receiverEmail, string cc, string bcc, SPWeb web,string from) { StringDictionary headers = new StringDictionary(); headers.Add("to", receiverEmail); headers.Add("cc", cc); headers.Add("bcc", bcc); headers.Add("from", from); headers.Add("subject", subject); headers.Add("content-type", "text/html"); headers.Add("fAppendHtmlTag", "true"); headers.Add("fHtmlEncode", "true"); SPUtility.SendEmail(web, headers, body.ToString());
No comments:
Post a Comment