簡體   English   中英

C# MailKit - 如何創建 Rtf 消息

[英]C# MailKit - How to create a Rtf message

我正在嘗試以 rtf 格式發送消息,但在接收時,gmail 等沒有正確解釋它(MacOS 上的 Mail.app 除外)。 這是一個示例代碼。 一些客戶端應用程序將其視為“文本”。

String body = @"{\rtf1\ansi\deff0{\colortbl;\red0\green0\blue0;\red255\green0\blue0;} This line is the default color\line \cf2 This line is red\line \cf1 This line is the default color}"
message.Body = new TextPart("rtf") { Text = body };

我哪里錯了?

正如jdweng指出的,大多數郵件客戶端不支持 RTF。

據我所知,谷歌郵件僅支持 HTML 和純文本消息。

I tried testing this by using Outlook to send an RTF message to GMail, but alas, my Exchange server always overrides the RTF by converting it to HTML and so GMail always receives text/html instead of text/rtf.

如果我將 Outlook 配置為通過某個非 Exchange 帳戶發送,我也許可以讓它發送文本/rtf,但我懶得打擾。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM