Hi there,
when I try to send an eMail to a recipient containing an umlaut, the umlaut ends up as Question Mark.
Umlauts in Subject and Body work just fine. I am using jdk 1.6.0.18/linux i386 and javamail 1.4.3:
MimeMessage m = new MimeMessage(s);
m.setFrom( new InternetAddress( "me@localhost" ) );
m.setRecipients( Message.RecipientType.TO, new InternetAddress[] {
new InternetAddress( "\"Schöne Umlaute\" <you@elsewhere.com>" ) // mail delivers but name is garbled
});
Multipart body = new MimeMultipart();
m.setSubject("Etwas schönes"); // works
MimeBodyPart part = new MimeBodyPart();
part.setText( "Ein schöner Inhalt." ); // works
body.addBodyPart(part);
m.setContent( body );
Turning session debugging on reveals that the recipient name is being sent verbatim, whereas the subject is being encoded,
so suspect the problem inside JavaMail. I tried both de_DE and de_DE.UTF-8 as LC_CTYPE.
What am I doing wrong?
Regards
-- Holger
Edited by: HolgerK on Jan 27, 2010 5:28 AM