2

我正在为 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 中。

所以我的下一个问题是弄清楚如何为消息添加唯一标签,以便稍后将其链接到数据库。有任何想法吗?

4

2 回答 2

1

您是否在消息上设置了任何用户属性?

如果您使用OutlookSpy (单击 IMessage 按钮)查看已发送邮件文件夹中的 Outlook 邮件,您是否看到 UseTnef 命名属性(DASL 名称http://schemas.microsoft.com/mapi/id/ {00062008-0000-0000 -C000-000000000046}/8582000B)?

于 2013-05-15T23:17:15.077 回答
1

几年前我遇到过这个问题。最后,我们使用 Outlook 热修复程序修复了它,而不是代码更改。

于 2013-05-15T22:37:04.373 回答