Hey guys, Today one of my reporting tool was having an issue with its mail content. The tool is suppose to give me report for the previous days management processes done by my users.
I have noticed that in the EMAIL content there were some Exclamation marks (!) at odd places.
Rober!t HAS DON!E 80! TRANSACTIONS likewise.
HOW TO FIX THIS ISSUE?
All you have to do is just add this HEADER on your PHP mail.
‘Content-Transfer-Encoding’ => ‘base64’
and encode the MAIL CONTENT like this
$base64_message_contents = rtrim(chunk_split(base64_encode($complete_message)));
The entire code will look similar to this.
$smtp = Mail::factory('smtp', array ('host' => '126.96.36.199', 'auth' => true, 'username' => '[email protected]', 'password' => '*****')); $headers = array ('From' => '[email protected]', 'Subject' => 'Report Trans','MIME-Version' => '1.0','Content-type' => 'text/html; charset=iso-8859-1','Content-Transfer-Encoding' => 'base64'); $base64_message_contents = rtrim(chunk_split(base64_encode($complete_message))); $mail = $smtp->send($mail_send[$i], $headers, $base64_message_contents );