cancel
Showing results for 
Search instead for 
Did you mean: 

Internationalization Java Mail

former_member1
Active Participant
0 Kudos

Dear All,

I have to send the mails in Arabic of content type text/html.

For this I ve tried 2 ways

1. setContent(MailMessage, text/html);

This method gives me output as ???? instead of Arabic text.

2. setText(MailMessage,utf-8);

This methods gives the text correctly, but displays in text/plain format.

Can any one help me in getting the Arabic text in text/html.

Thanks in Advance

Anish

Accepted Solutions (1)

Accepted Solutions (1)

former_member182294
Active Contributor
0 Kudos

Hi Anish,

The method setText(MailMessage,utf-8) - works only with MIME type text/plain.

Try using the setContentLanguage(String language[]) method. And also make sure that you are using MimeMessage type.

Regards

Abhilash

former_member1
Active Participant
0 Kudos

Hi Abhilash,

Thanks for reply.

I tried that, but still I am getting ???...

I am using MimeMessage class only.

Regards,

Anish

former_member182294
Active Contributor
0 Kudos

Hi Anish,

Try out this <b>setContent(Message, "text/html;charset=utf-8"); </b>

Regards

Abhilash

former_member1
Active Participant
0 Kudos

Hi Abhilash,

I have tried it but its not working as well.

Apart from it I ve tried setting header and giving the character set there. But that also didnt worked.

Regards,

Anish

former_member182294
Active Contributor
0 Kudos

Hi Anish,

This is the standard way of doing it..

Sorry, there should be a space between text/html and charset=utf-8

<b>setContent(Message, "text/html; charset=utf-8");</b>

Try this and let me know if it works.

Regards

Abhilash

former_member1
Active Participant
0 Kudos

Thanks Abhilash, Thanks for the help.

Encoding the header solved my problem.

Regards,

Anish

Answers (0)