473,396 Members | 1,764 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Mail encoding problem

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
2 5098
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Wolfgang Uhr | last post by:
Hello I have a small Problem by using the mail() command from php. To surround the problem, I do the following: 1. I go to the server and send me a mail using the linux-mail-Command. In...
0
by: Merijn Boom | last post by:
Hi there, I'm trying to create an html mail with embedded pictures in it. I run perl on Windows and Red Hat but I cannot get your module (Mail::Sender) to work. I'm just trying to run the...
8
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- ...
1
by: David Dvali | last post by:
Hello. I have a problem with sending Unicode text in mail message. So what I do: First of all I have some template file like this: ================================= <html> <head><title>Test...
4
by: Robert McNally | last post by:
Hello, I'm currently learning c# and have been trying to write a simple program with sockets. The problem is i'm trying to send an email with an attachment, (which is the program itself) by...
2
by: Husam | last post by:
Hi EveryBody: I made windows application project as e-mail sender. This project consist of 13 textbox and one label and one button. I add {system.web.dll} as refrance to this project to help me...
6
by: cover | last post by:
I'm using PHP 5 at home w/Apache & MySQL on a test system where I write through a form to a database and also send an email to people on a drop down list. Purpose for this is an electronic log at...
2
by: =?Utf-8?B?QWRl?= | last post by:
HI All, I am encountering the following error when I try to send an email through a SMTP server. I believe the problem lies with the authentication part when the network crednetials are used,...
10
by: amygdala | last post by:
Hi all, Another problem that has been bugging me for a while now, but which I swept under the rug too long too now is a mail encoding problem at my (shared) webhost. The problem is that on...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.