Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to send text using ISO-8559-1

843830Sep 4 2003 — edited Oct 27 2003
I need to send an email using the ISO-8559-1 charSet but cannot figure out exactly what to do. Using the following code I receive the HTML emails as expected, but get an "Unsupported Encoding Exception". I am not even sure if what follows is the correct way to do this. Any help would be appreciated.


The following is what I have:

Message message = new MimeMessage(session);
message.setFrom(new InternetAddress(cSendFrom));
InternetAddress[] address = {new InternetAddress(cSendTo)};

message.setRecipients(Message.RecipientType.TO, address);
message.setSubject(cSubject);
message.setSentDate(new Date());


if (cCharSet.length() > 0) {
   message.setContent(MimeUtility.encodeText(cPlainTextMsg, cCharSet, "Q"));
}
else {
   message.setText(cPlainTextMsg);
}
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 24 2003
Added on Sep 4 2003
3 comments
250 views