JavaMail 1.3 - Character encodings?
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Didde_Brockman
Posted On:   Sunday, November 24, 2002 06:29 AM

I am trying to send a HTML formatted e-mail with the code below. No matter what I do I just cannot seem to get certain swedish characters to work at all. I even tried replacing the Å, Ö and Ä with å, ö and ä but the e-mail still parses them as "Â" and so on. Completely off. What am I missing here, anyone? Properties props = new Properties(); props.put("mail.host", host); Session session = Session.getDefaultInstance(props, null); Message message = new MimeMessage(session); message.setFrom(InternetAddress.parse(from)[0]); message.setSubject(subject); message.setSentDate(new java.util.Date()); message.addRecipients(Message.RecipientType.   More>>

I am trying to send a HTML formatted e-mail with the code below. No matter what I do I just cannot seem to get certain swedish characters to work at all.

I even tried replacing the Å, Ö and Ä with å, ö and ä but the e-mail still parses them as "Â" and so on. Completely off.

What am I missing here, anyone?

			

Properties props = new Properties();
props.put("mail.host", host);
Session session = Session.getDefaultInstance(props, null);
Message message = new MimeMessage(session);
message.setFrom(InternetAddress.parse(from)[0]);
message.setSubject(subject);
message.setSentDate(new java.util.Date());
message.addRecipients(Message.RecipientType.TO, InternetAddress.parse(to));
message.setContent(body, contenttype);
Transport.send(message);

   <<Less

Re: JavaMail 1.3 - Character encodings?

Posted By:   Jeff_Gay  
Posted On:   Tuesday, November 26, 2002 06:04 AM

Why not use setText() on the message?
You can find more information in the JavaMail FAQ.

Re: JavaMail 1.3 - Character encodings?

Posted By:   John_Zukowski  
Posted On:   Monday, November 25, 2002 05:53 AM

Are you using a character encoding in the content type?
About | Sitemap | Contact