require("phpmailer.inc.php");
class sendmail
{
public static function sendAccountActivateMail($to,$subject,&message)
{
$flg = false;
try
{
$mail= new PHPMailer();
$mail->IsSMTP();
$mail->SMTPAuth= true;
$mail->SMTPSecure= "tls";
$mail->Host= "smtp.gmail.com";
$mail->Port= 587;
$mail->Username= "xxx@mydomain.com";
$mail->Password= "xxxxxx";
$mail->AddReplyTo("info@mydomain.com");
$mail->From= "info@mydomain.com";
$mail->FromName= "Website";
$mail->Subject= $subject;
$mail->WordWrap= 50;
$mail->Body = $message;
$mail->AddAddress($to);
$mail->Send();
}
catch(Exception $e)
{
$flg = false;
}
return $flg;
}
}
Trying to send mail through phpmailer using smtp. turning on debugging gives me an error:
SMTP → ERROR: RCPT is not received from the server: 550 SMTP AUTH is required to send a message to port 587 SMTP → ERROR: the DATA command is not received from the server: SMTP → NOTIFICATION: EOF is caught during verification if it is connected
Vinay source
share