I have the below part of code which works fine but all of a sudden it started not working (The mail is not getting delivered) from today. I had a look inthe SO regarding this and didn't find any suitable answers.
 $content = chunk_split(base64_encode($mpdf->Output($file.'.pdf', 'S')));
 $separator = md5(time());
 $eol = PHP_EOL;
 $headers = "From: ".$fromemail['Fromemail'] . $eol;
 $headers .= "Cc: ".$ccemail['Email'] . $eol;
 $headers .= "Importance: High\n"; 
 $headers .= "MIME-Version: 1.0".$eol; 
 $headers .= "Content-Type: multipart/mixed;boundary=\"" . $separator . "\"".$eol.$eol;
 // message
 $body .= "Content-Transfer-Encoding: 7bit".$eol;
 $body .= "This is a MIME encoded message.".$eol;
 $body = "--" . $separator.$eol;
 $body .= "Content-Type: text/html; charset=\"UTF-8\"".$eol;
 $body .= "Content-Transfer-Encoding: 8bit".$eol.$eol;
 $body .= $message.$eol;
 // attachment
 $body .= "--" . $separator.$eol;
 $body .= "Content-Type: application/octet-stream; name=\"" . $filename . '.pdf' . "\"".$eol;
 $body .= "Content-Transfer-Encoding: base64".$eol;
 $body .= "Content-Disposition: attachment".$eol.$eol ;
 $body .= $content.$eol;
 $body .= "--" . $separator . "--";
 //SEND Mail
 if (mail($mailto, $subject, $body, $headers)) {
         //echo "mail send ... OK"; // or use booleans here
  } 
Please let me know where I went to a wrong direction.
 
    