I\'m trying to send unicode emoji trough PHPMailer (5.2) but the emails I sent are received with weird characters instead of emojis. I\'m currently sending HTML emails where
It turns out that PHPMailer uses charset=iso-8859-1 by default in HTML emails (in the email header you'll find Content-Type: text/html; charset=iso-8859-1
while you should use UTF-8: Content-Type: text/html; charset=UTF-8
.
You can set the charset in PHPMailer by doing:
$mail = new PHPMailer();
$mail->CharSet = 'UTF-8';
I needed to use the slightly different:
$mail = new PHPMailer();
$mail->CharSet = 'utf-8';