I know this is late, but there is an alternative solution that worked for me:
Use this line to encode the entire message with base64:
$message = chunk_split(base64_encode($message));
Then add this heading:
$headers .= "Content-Transfer-Encoding: base64\r\n\r\n";
This will tell the email client that your message is base64 encoded.
source share