Missing new line in MailMessage sent by System.Net.Mail.SmtpClient

420 views Asked by At

I'm using System.Net.Mail.SmtpClient to send a MailMessage. It is a simple text message and mostly working fine.

An example SMTP message is shown below. Notice the line:

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

I expect this line to be formatted with a new line separating the terms:

Call reason: Intermittent Internet connection
Application reports:  

However, when viewing the message in Outlook, these are shown without a line break as:

Call reason: Intermittent Internet connection Application reports: 

All of the other =0D=0A line breaks seem to work fine.

I'm using the defaults for MailMessage, so BodyEncoding is us-ascii. I don't think I have an encoding problem because my newlines are all converted to =0D=0A in the sent message.

Why am I losing the new line in that one place?

Here is the SMTP message (with a few changes to obscure names and email addresses)

X-Sender: [email protected]
X-Receiver: [email protected]
X-Receiver: [email protected]
X-Receiver: [email protected]
MIME-Version: 1.0
From: [email protected]
To: [email protected]
Cc: [email protected], [email protected]
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

There are 0 answers