New System.Net.Mail.MailMessage Body Square characters

I am trying to create multiline body using VB 2005. I dynamically build up the body with the following code:

If strLine <>""Then
msgBuilder.Append(strLine.Trim() & Environment.NewLine)
EndIf

After converting to string, the final result results are added to the Message.Body and the email is sent. There are no problems sending the message. The problem is that carriage return and linefeed appear as square boxes in the message body. I've tried using vbCrLf, vbLf, Chr(13), Chr(10). They all appear as square boxes in the message body.

How can I force a new line in the message body without it appearing as a square character?

[1019 byte] By [jkrakowsky] at [2007-12-17]
# 1

Can you get a trace log of the problem. Here is what I would suggest for your app.exe.config file (see http://blogs.msdn.com/dgorti/archive/2005/09/18/471003.aspx for more information on trace logging):

<?xml version="1.0" encoding="UTF-8" ?>

<configuration>
<system.diagnostics>
<trace autoflush="true" />
<sources>
<source name="System.Net">
<listeners>
<add name="System.Net"/>
</listeners>
</source>
<source name="System.Net.HttpListener">
<listeners>
<add name="System.Net"/>
</listeners>
</source>
<source name="System.Net.Sockets">
<listeners>
<add name="System.Net"/>
</listeners>
</source>
<source name="System.Net.Cache">
<listeners>
<add name="System.Net"/>
</listeners>
</source>
</sources>
<sharedListeners>
<add
name="System.Net"
type="System.Diagnostics.TextWriterTraceListener"
initializeData="System.Net.trace.log"
/>
</sharedListeners>
<switches>
<add name="System.Net" value="Verbose" />
<add name="System.Net.Sockets" value="Verbose" />
<add name="System.Net.Cache" value="Verbose" />
<add name="System.Net.HttpListener" value="Verbose" />
</switches>
</system.diagnostics>
</configuration>

JonCole at 2007-9-8 > top of Msdn Tech,.NET Development,.NET Framework Networking and Communication...
# 2

I still haven't seen the trace of the issue. I would love to help you but can't do anything without more information. The reason I want to see the trace is because I am interested in seeing what byte values are being sent on the wire.

JonCole at 2007-9-8 > top of Msdn Tech,.NET Development,.NET Framework Networking and Communication...

.NET Development

Site Classified