The answers here have the correct information about the length of the string, however, none of them provided me with a sufficient piece of code to fix the problem. I looked around and found a better way to do this, here it is:
<?php // send base64 encoded email to allow large strings that will not get broken up // ============================================== $eol = "\r\n"; // a random hash will be necessary to send mixed content $separator = md5(time()); $headers = "MIME-Version: 1.0".$eol; $headers .= "From: Me < info@example.com >".$eol; $headers .= "Content-Type: multipart/alternative; boundary=\"$separator\"".$eol; $headers .= "--$separator".$eol; $headers .= "Content-Type: text/html; charset=utf-8".$eol; $headers .= "Content-Transfer-Encoding: base64".$eol.$eol; // message body $body = rtrim(chunk_split(base64_encode($html))); mail($email, $subject, $body, $headers); // ==============================================
source share