I'm using the PHP mailer class and everything is working exactly as I want it to. There is only one problem and it only happens to happen with Yahoo mail. First, here's my code:
$body = "<p>Hello</p>";
$body .= "<p>World</p>";
$mail = new PHPMailer();
$mail->IsSMTP(); // telling the class to use SMTP
$mail->IsHTML(true);
$mail->SMTPAuth = true;
$mail->Hostname = "domain.com";
$mail->Username = "name@domain.com"; // your SMTP username
$mail->Password = "Password"; // your SMTP password
$mail->Host = "ssl://smtp.domain.com"; // SMTP server
$mail->Port = "PORT";
$mail->From = $from;
$mail->FromName = $fromname;
$mail->AddAddress($to);
$mail->Subject = $subject;
$mail->Body = $body;
if(!$mail->Send()) {
echo 'Message was not sent.';
echo 'Mailer error: ' . $mail->ErrorInfo;
} else {
}
When sending it to a gmail or hotmail address, the mail comes out perfectly as:
Hello
World
But when sending it to a Yahoo address, it comes out as
Hello
World
The body is obviously longer, so it's really hard to read for Yahoo users. Is there a reason for this strange formatting in Yahoo?