缺少System.Net.Mail.SmtpClient发送的MailMessage中的新行

时间:2013-12-05 00:00:36

标签: c# .net smtp system.net.mail

我正在使用System.Net.Mail.SmtpClient发送MailMessage。这是一条简单的短信,大部分工作正常。

示例SMTP消息如下所示。注意这一行:

=0D=0ACall reason: Intermittent Internet connection=0D=0AApplicat=

我希望这一行格式化为一个分隔术语的新行:

Call reason: Intermittent Internet connection
Application reports:  

但是,在Outlook中查看邮件时,这些邮件没有换行符显示为:

Call reason: Intermittent Internet connection Application reports: 

所有其他= 0D = 0A换行似乎工作正常。

我正在使用MailMessage的默认值,因此BodyEncoding是us-ascii。我不认为我有编码问题,因为我的换行符在发送的消息中都被转换为= 0D = 0A。

为什么我会在那个地方失去新线?

以下是SMTP消息(对名称和电子邮件地址进行了一些更改)

X-Sender: sender@sample.com
X-Receiver: touser@example.com
X-Receiver: cc1user@example.com
X-Receiver: cc2user@example.com
MIME-Version: 1.0
From: sender@sample.com
To: touser@example.com
Cc: cc1user@example.com, cc2user@example.com
Date: 4 Dec 2013 16:56:58 -0500
Subject: Project Pilot
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable

Email type: User requests callback response=0D=0ASubmitted: 12/4/=
2013 5:46 PM=0D=0A=0D=0AUser ID: widget.proxy=0D=0AAccount num=
ber: 12345-678901-23=0D=0A=0D=0ARequested call time: 12/4/2013 7:=
16 PM=0D=0AContact phone #: (212) 555-1212=0D=0AService: internet=
=0D=0ACall reason: Intermittent Internet connection=0D=0AApplicat=
ion reports: =0D=0A=0D=0AUser comments: =0D=0A=0D=0ASession: 7060=
35D4-3FD0-4CFD-AD40-0A951DA09838=0D=0A

0 个答案:

没有答案