<?php
require_once "vendor/autoload.php";
$mail = new PHPMailer;
$mail->SMTPDebug = 0;
$mail->isSMTP();
$mail->Host = "localhost";
$mail->SMTPAuth = false;
$mail->Username = "xxx@xxxx.com";
$mail->Password = "xxxxxxx";
$mail->SMTPSecure = "tls";
$mail->Port = 25;
$mail->From = "xxx@xxxxx.com"
$mail->FromName = "xxx";
$mail->addAddress("example@gmail.com", "example");
$mail->isHTML(true);
$mail->Subject = "Test";
$mail->Body = "<i>Helo</i>";
$mail->AltBody = "This is the plain text version of the email content";
if(!$mail->send())
{
echo "Mailer Error: " . $mail->ErrorInfo;
}
else
{
echo "Message has been sent successfully";
}
?>
Mailer Error:
SMTP Error: data not accepted.SMTP server error: DATA END command failed Detail: Missing internal data in the header. Message discarded. SMTP code: 550