Japanese Characters Show up as ??? when email is sent from aspx page

G

Guest

I have an aspx page where user fill-in fields and then hit submit button. All text and text values are in Japanese Language(Shift-JIS). This page sends an email to outlook users. Once user receives email, all these japanese characters gets converted into ????(question marks). On web browser page show up all japanese characters correctly but in outlook email it doesn't. Following is the code sample from the aspx page I am using to accomplish this. Please post any helpful information regarding how this issue could be resolve

Dim objMM as New MailMessage(
objMM.To = ddlApprovingManagerCDSID.SelectedItem.value
objMM.BodyFormat = MailFormat.Htm
objMM.Priority = MailPriority.Norma
objMM.Subject = "æ–°ã—ã„IMACリクエスト - " & txtCDSID.Tex
objMM.Body = "Japanese Languge Characters like æ–°ã—ã„IMACリクエスト
SmtpMail.SmtpServer = "abcsmtp.somecompany.com
SmtpMail.Send(objMM

Regard

Muhammad Ahma
IBM Global Services
 
M

Muhammad Ahmad

Hi, Natty Gur

Thanks for the reponse. With

MyMessage.BodyEncoding = Encoding.Unicode

email body doesn't show up anything in outlook email at all. All it
shows is following in the email subject.
=?unicode?B?Pz8/SU1BQz8/Pz8/IC0gbWFobWFkMg==?=

and thats in the email subject and nothing show up in email body???

Is there anyway I could use any form of "Shift-JIS" with BodyEncoding ?
It errors out if use it this way???

Muhammad Ahmad
 
B

Bill

MyMessage.BodyEncoding = Encoding.GetEncoding("Shift-JIS");

That should work as long as you have the Shift Jis code page insatlled on
the system.

The only correct way to send non-ascii characters in an email message header
is to encode them as the below subject was encoded. If the mail client you
are reading the message with does not support this type of encoding you will
have trouble viewing the message.

Bill
http://bill.atwill.com/
 
M

Muhammad Ahmad

Hi, Bill

It was great help. Thank you so much. Encoding.GetEncoding("Shift-JIS")
did work perfect. Thanks for that. Only issue right now is with the
email subject which is still getting converted to "??????". The email
body show up correctly with the desired characters.

Muhammad Ahmad
IBM Global Services
 
B

Bill

If when you open the message in text view and it contains
Subject: =?iso-2022-jp?B?GyRCPzckNyQkGyhCSU1BQxskQiVqJS8lKCU5JUgbKEIgLSA=?=
Then it is probably the mail client you are using to view the message. It
may not support non ascii text in the subject. I ran the below code and
opened the message in outlook express and it worked 100%.

Bill
http://bill.atwill.com

MailMessage objMM = new MailMessage();

objMM.To = "myaddress@domain";

objMM.From = myaddress@domain;

objMM.Priority = MailPriority.Normal;

objMM.BodyEncoding = System.Text.Encoding.GetEncoding("SHIFT-JIS");

objMM.Subject = "???IMAC????? - ";

objMM.Body = "Japanese Languge Characters like ???IMAC?????";

SmtpMail.Send(objMM);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top