Notes on Java, Solaris, PHP, LDAP…

September 11, 2008

Unicode emails via PHPMailer

Filed under: Java — negev @ 10:58 am
Tags: ,

My web app has a form and then it sends emails via PHPMailer. But it didn’t work for Unicode messages.

I added accept-charset=”utf-8″ to the <form> tag. Then I changed $CharSet setting from default ‘iso-8859-1’ to ‘utf-8’. That worked for Unicode email body, but not for Unicode subject. In order to get Unicode subjects work I had to update PHPMailer to version 2.0.2.

var $CharSet           = ‘utf-8′; //’iso-8859-1’;
var $ContentType        = ‘text/plain’;
var $Encoding          = ‘8bit’;


1 Comment »

  1. Hi,
    I have wordpress on my site, and I have the same issue – the subject of the emails I receive about the comments on site – thru wordpress – which is supposed to be in unicode – it turns everything in junk characters.

    Do you know if I can get the details of step by step instructions for this? I understand that you have given the solution here, but i am not a tech person, so I didnt understand this completely.

    Thank you,

    Comment by Jayshree — October 7, 2008 @ 4:12 pm | Reply

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at

%d bloggers like this: