I keep getting this error.
below is my code:
<?php
ini_set("include_path", "phpmailer/");
require 'phpmailer/class.phpmailer.php';
$mailer = new PHPMailer();
$mailer->IsSMTP();
$mailer->Host = 'smtp.gmail.com';
$mailer->Port='465';
$mailer->SMTPAuth = TRUE;
$mailer->Username = 'mail@gmail.com';
$mailer->Password = '****';
$mailer->From = 'maile@gmail.com';
$mailer->FromName = 'Belmer';
$mailer->Body = 'This is the main body of the email';
$mailer->Subject = 'This is the subject of the email';
$mailer->AddAddress('another@ymail.com');
if(!$mailer->Send())
{
echo "Message was not sent<br/ >";
echo "Mailer Error: " . $mailer->ErrorInfo;
}
else
{
echo "Message has been sent";
}
?>
Does anyone know this error? Your reply is greatly appreciated.
source
share