C# 中新行/回车生成的 Outlook 电子邮件

本文关键字:Outlook 电子邮件 回车 新行 | 更新日期: 2023-09-27 18:37:14

也许 Outlook 只是将其格式化为 Outlook 希望它的外观,bc 代码对我来说看起来不错,也许你们中的一位大师可以告诉我如何添加回车符(让下一个以前的雇主出现在下一行)

Outlook.Application oApp = new Outlook.Application();
Outlook.MailItem oMsg = (Outlook.MailItem)oApp.CreateItem         
(Outlook.OlItemType.olMailItem);                
string content = string.Empty;
string content = previousEmployer + Environment.NewLine;
//I have also tried this to no avail
//string content = previousEmployer + "'n";
oMsg.HTMLBody = content;
Outlook.Recipients oRecips = (Outlook.Recipients)oMsg.Recipients;
Outlook.Recipient oRecip = (Outlook.Recipient)oRecips.Add("alphaomegaentry.com");
oRecip.Resolve();
oMsg.Save();
oRecip = null;
oRecips = null;
oMsg = null;
oApp = null;

C# 中新行/回车生成的 Outlook 电子邮件

如果 HTMLBody 确实需要包含 HTML,你可以试试这个:

string content = string.Format("{0}<br />", previousEmployer);
oMsg.HTMLBody = content;