我正在为 Outlook 2007 编写一个加载项。一切正常,除了当我以 HTML 格式发送电子邮件时,Outlook 将其转换为 RTF。因此,如果收件人在例如打开它。Thunderbird 他收到了一条看起来很奇怪的短信,而不是我发送的格式良好的 html。
Outlook.MailItem theMail = (Outlook.MailItem)((Outlook.Application)Globals.ThisAddIn.Application).CreateItem(Outlook.OlItemType.olMailItem);
Outlook.Recipient rcp = theMail.Recipients.Add("joe blow <joe@blow.com>");
rcp.Type = (int)Outlook.OlMailRecipientType.olTo;
theMail.HTMLBody = <html composed elsewhere>
theMail.BodyFormat = Outlook.OlBodyFormat.olFormatHTML;
如何让 Outlook 相信我真的想要 html?
编辑好的 - 我在 MSDN 上发现了问题我正在添加一个用户属性
Outlook.UserProperty prop = theMail.UserProperties.Add("theQuoteId", Outlook.OlUserPropertyType.olText);
prop.Value = quote.qid.ToString();
根据文章,该属性无法映射到 mime 标头,Outlook 将其扔到 RTF 中。
所以我的下一个问题是弄清楚如何为消息添加唯一标签,以便稍后将其链接到数据库。有任何想法吗?