【问题标题】:Stop Outlook from converting HTML to RTF阻止 Outlook 将 HTML 转换为 RTF
【发布时间】:2022-05-17 06:21:55
【问题描述】:

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

编辑 好的 - 我在这里找到了问题 at MSDN 我正在添加用户属性

Outlook.UserProperty prop = theMail.UserProperties.Add("theQuoteId", Outlook.OlUserPropertyType.olText);
prop.Value = quote.qid.ToString();

根据文章,该属性无法映射到 mime 标头,Outlook 将其扔到 RTF 中。

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

【问题讨论】:

  • 是否需要设置 MIME 类型?在 HTTP 中,解释问题通常是因为发送的文件使用了错误的 MIME 类型。 (我猜MailItem.BodyFormat 是这个,但我希望缺少一些东西,因为这意味着修复相对容易......)
  • 我不认为它是 mime 类型 - Outlook 创建一个 rtf 正文并将其附加到电子邮件中。

标签: c# .net outlook


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2010-10-01
    • 1970-01-01
    • 2014-11-15
    • 2012-02-17
    • 2011-09-28
    • 1970-01-01
    • 1970-01-01
    • 2015-10-27
    相关资源
    最近更新 更多