dcsimg
how MimeMessage support internalized character set?
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Mason_Z
Posted On:   Friday, July 31, 2009 02:18 AM

Hi, i use jsp to collect input from the previous page and use MimeMessage to send email using the input into the subject and body. the problem is some users use other input languages, which can be Japanese or Spanish. so the emails come out with funny characters. Though the characters can be displayed fine on the jsp. i used this code and it doesn't work: msg.setContent(bodytext, "text/plain; charset=iso-8859-1"); or msg.setContent(company, "text/plain; charset=iso-8859-1"); or this: msg.setText(MimeUtility.encodeText(company,DefaultCharSet,"B")); msg.setHeader( "Content-   More>>

Hi,


i use jsp to collect input from the previous page and use MimeMessage to send email using the input into the subject and body. the problem is some users use other input languages, which can be Japanese or Spanish. so the emails come out with funny characters. Though the characters can be displayed fine on the jsp.


i used this code and it doesn't work:


msg.setContent(bodytext, "text/plain; charset=iso-8859-1");


or


msg.setContent(company, "text/plain; charset=iso-8859-1");


or this:


msg.setText(MimeUtility.encodeText(company,DefaultCharSet,"B"));


msg.setHeader( "Content-Transfer-Encoding", "base64" );



they don't work.


what can i do?


thanks!


C

   <<Less
About | Sitemap | Contact