Proner
Mar 20th, 2006, 09:07 AM
Hi,
Here is a recurrent problem I encounter when trying to send an email with non-ASCII characters.
First of all, the code which sends the email :
MimeMessage message = sender.createMimeMessage();
MimeMessageHelper helper = new MimeMessageHelper(message, "ISO-8859-1");
helper.setFrom("***");
helper.setTo("***");
helper.setSubject("***");
StringBuffer sb = new StringBuffer();
sb.append("Un test avec des caractères accentués");
helper.setText(sb.toString());
try {
sender.send(message);
} catch (MailException me) {
logger.error(me.getMessage());
} catch (Exception e) {
logger.error(e.getMessage());
}
Within the mail I receive all accentuated characters replaced by '?'.
The header part of the mail does display :
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
I'm pretty sure that the problem comes from the 7bit encoding, but I don't find the way to change this value by "8bit".
I think that I misunderstood something, so any help will be appreciated.
Steph
Here is a recurrent problem I encounter when trying to send an email with non-ASCII characters.
First of all, the code which sends the email :
MimeMessage message = sender.createMimeMessage();
MimeMessageHelper helper = new MimeMessageHelper(message, "ISO-8859-1");
helper.setFrom("***");
helper.setTo("***");
helper.setSubject("***");
StringBuffer sb = new StringBuffer();
sb.append("Un test avec des caractères accentués");
helper.setText(sb.toString());
try {
sender.send(message);
} catch (MailException me) {
logger.error(me.getMessage());
} catch (Exception e) {
logger.error(e.getMessage());
}
Within the mail I receive all accentuated characters replaced by '?'.
The header part of the mail does display :
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
I'm pretty sure that the problem comes from the 7bit encoding, but I don't find the way to change this value by "8bit".
I think that I misunderstood something, so any help will be appreciated.
Steph