By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,292 Members | 1,354 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,292 IT Pros & Developers. It's quick & easy.

Mail encoding problem

P: n/a
Im trying to send mail using this code:

MailMessage mail = new MailMessage();

mail.From = "fe**@mydomain.com";

mail.Subject = "some subject";

mail.Priority = MailPriority.Normal;

mail.Body = body;

mail.BodyFormat = MailFormat.Text;

mail.To = to;

SmtpMail.SmtpServer = "XXXX";

SmtpMail.Send( mail );

Using the same SmtpServer the result if this is very different depending on
the client computer running the code. If using Danish chars "" that
is. I guess this is due to different locale settings on the client
computers.

But how can I get passed this problem? I tried

mail.BodyEncoding = "iso-8859-1";

(and some other encodings)

But this makes it even worse.... This mail is unreadable on the reciving
end. What setting on the client computer sets the encoding on the mail -
what should I check to find the problem?

Jan Agermose


Nov 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On the client that works this is part of the header information:

MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
X-Mailer: Microsoft CDO for Windows 2000

And this is some of the headerinformation on the client that sends
unreadable mail

MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: base64
X-Mailer: Microsoft CDO for Windows 2000

How do I set "Content-Transfer-Encoding"????

Ragrds
Jan Agermose

"Jan Agermose" <ms**@csite.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Im trying to send mail using this code:

MailMessage mail = new MailMessage();

mail.From = "fe**@mydomain.com";

mail.Subject = "some subject";

mail.Priority = MailPriority.Normal;

mail.Body = body;

mail.BodyFormat = MailFormat.Text;

mail.To = to;

SmtpMail.SmtpServer = "XXXX";

SmtpMail.Send( mail );

Using the same SmtpServer the result if this is very different depending on the client computer running the code. If using Danish chars "" that
is. I guess this is due to different locale settings on the client
computers.

But how can I get passed this problem? I tried

mail.BodyEncoding = "iso-8859-1";

(and some other encodings)

But this makes it even worse.... This mail is unreadable on the reciving
end. What setting on the client computer sets the encoding on the mail -
what should I check to find the problem?

Jan Agermose



Nov 18 '05 #2

P: n/a
Hi Jan,

I am not familiar with the Danish so I have not fully tested this issue.
Thank you for your understanding.

Based on my research and experience, please try to set the Encoding to
Unicode and test this issue again:

1. mail.BodyEncoding = Encoding.Unicode;

2. mail.BodyEncoding = Encoding.UTF8;

3. mail.BodyEncoding = Encoding.UTF7;

If I have misunderstood your concern, please feel free to let me know.

Best regards,

Jacob Yang
Microsoft Online Partner Support
Get Secure! C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.