The Content-Type and Content-Transfer-Encoding headers apply only to the body of your message. For headers, there is a mechanism for specifying their encoding specified in RFC 2047.
code:
$smtp->set('Subject', "=?UTF-8?Q?".imap_8bit($subject)."?=");Must enable "extension=php_imap"