PHP email subject encoding UTF-8

11:38 AM by Christian Koch

Filed under php

Last modified Tuesday September 8th, 2015

To fix the encoding of email subject that you send with PHP wrap your subject in ‘=?UTF-8?B?’ / “?=” and also use the PHP function base64_encode() to encode your original subject. Check out the code sample:

$subject = 'äüöß';
$subject = '=?UTF-8?B?'.base64_encode($subject).'?=';


Related Articles

                                                          Leave a Comment