JavaMail: Error in subject “=?ANSI_X3.4-1968?Q?Testmail….
You using the JavaMail API (this is the case if you use JBoss Application Server) and you send mails with special characters like German umlauts ä,ü,ö or something else. The JavaMail Api checks the system property “file.encoding” and if set the property “mail.mime.charset”. If your program runs on a linux server like suse 10, the default charset is ANSI_X3.4-1968. In Mozilla Thunderbird you get rubbish in the subject line
=?ANSI_X3.4-1968?Q?Testmail_-_Best=3Ftigung_Ihrer_eMail-Adresse?=
To get a clean subject like “Testmail – Bestätigung Ihrer eMail Adresse”, you must use the charset Cp1252.
Just put this command in your java code:
System.setProperty("mail.mime.charset","Cp1252");
Important for JBoss: You have to restart JBoss.

August 25th, 2006 at 20:57
Danke, hat sehr geholfen. Ist allerdings nicht nur mit Cp1252 zu verwenden.
September 9th, 2006 at 20:27
Hi,
ich hatte bei mir das gleiche Probleme. Mit eurer Hilfe klappt es jetzt. Das war genau das was ich suchte.
Danke
November 30th, 2006 at 20:10
Toll, wir sitzen hier und freuen uns riesig. Danke 1000x mal und mehr.
Kalle @ silbebuechse
Februar 7th, 2009 at 00:46
Ohja!
Danke!
2h musste ich Google bedienen, um das hier zu finden.
Wer hätte auch erwartet, dass so dämliches Verhalten irgendwo dokumentiert ist…?