我试图更改发件人的名称和电子邮件地址,但当我收到电子邮件时,它显示如下:
我希望“FROM”电子邮件地址的显示格式如下:
My network <commity@company.com [My network <commity@company.com]
我的代码如下
const string from = "My network <commity@company.com>";
StringDictionary headers = new StringDictionary();
headers.Add("to", invitee.userEmail);
headers.Add("subject", ltEmailSubject.Text);
headers.Add("from", from);
headers.Add("content-type", MediaTypeNames.Text.Html);
_emailSuccessful = SPUtility.SendEmail(elevatedSite.RootWeb, headers,
emailBody + Environment.NewLine + "");
我希望“FROM”电子邮件地址的显示格式如下:
My network [commity@company.com]