Yahoo showing blank email body for php 5.4

46 views Asked by At

I have two boxes. One with PHP 5.4 and other with PHP 5.2

I am trying to send an email from box with php 5.4. Gmail is getting the email body correctly. Yahoo is getting a blank body.

Box with php 5.2 is sending the same email with valid body to yahoo.

It is just not working in 5.4 box.

DKIM headers passed in the email from 5.4 box.

Am I missing something?

function sendtestemail() {

    $newLineChar = "\n";
    $someEmailBoundaryy = "----=_".md5(uniqid(time()));
    $headerString = 'From: ' . "[email protected]" . $newLineChar;
    $headerString .= 'Reply-To: ' . "[email protected]" . $newLineChar;
    $headerString .= 'Return-Path: ' . null . $newLineChar;
    $headerString .= 'MIME-Version: 1.0' . $newLineChar;
    $headerString .= 'Content-Type: multipart/alternative; boundary="' . $someEmailBoundaryy . '"' . $newLineChar;
    $messageText = "Some message without new line";


    $message = "--" . $someEmailBoundaryy . $newLineChar;
    $message .= "Content-Type: text/plain; charset=utf-8".$newLineChar;
    $message .= "Content-Transfer-Encoding: 8bit".$newLineChar;
    $message .= strip_tags($messageText) . $newLineChar.$newLineChar;
    $message .= "--".$someEmailBoundaryy. $newLineChar;
    $message .= "Content-Type: text/html; charset=utf-8".$newLineChar;
    $message .= "Content-Transfer-Encoding: 8bit".$newLineChar;
    $message .= nl2br($messageText).$newLineChar.$newLineChar;
    $message .= "--".$someEmailBoundaryy."--" ;

    @mail ( "[email protected], [email protected]", "Test from sender", $message, $headerString , "[email protected]");
}
0

There are 0 answers