Sending UTF-8 + HTML messages.

Hi all,

I'm working on sending Turkish email to our customers, notify them that they need to activate their account before using our product. Email should contain a link that customers will click on, and it should be in Turkish. I store all messages in .properties file.

MimeMessage message =new MimeMessage(session);

message.setFrom(new InternetAddress(EMAIL_FROM));

// compose body text

String body += text from .properties file

message.setText(body,"UTF-8");//( 1)

or

message.setContent(body,"text/html");// (2)

I tried both (1) and (2) alternative, when I tried (1) all Turkish text could be rendered properly but it was not in HTML format at all.

When I tried (2), text couldn't rendered in UTF-8 form, but for HTML it worked well.

1)Am I able to use both of 2 these forms in email? or can just use one of them: UTF-8 or HTML.

2) Is there any way that I can set character encoding before sending message out?

Regards,

[1223 byte] By [jimfixera] at [2007-11-27 10:01:34]
# 1
I got it fixed, simply put some more text into this:message.setContent(body, "text/html; charset=utf-8");Thanks for reading.
jimfixera at 2007-7-13 0:34:48 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2
Or use the new JavaMail 1.4 methodmessage.setText(body, "utf-8", "html");
bshannona at 2007-7-13 0:34:48 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...