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= "[email protected]";
$mail->Password= "xxxxxx";
$mail->AddReplyTo("[email protected]");
$mail->From= "[email protected]";
$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 with smtp. turning on debug gives me error:
SMTP -> ERROR: RCPT not accepted from server: 550 SMTP AUTH is required for message submission on port 587 SMTP -> ERROR: DATA command not accepted from server: SMTP -> NOTICE: EOF caught while checking if connected
SMTP error from remote mail server after RCPT TO:<[email protected]>: 550 5.1.1 <[email protected]> Recipient not found. Cause: The mail delivery error ‘SMTP error from remote mail server after RCPT TO:’, can be caused by a range of issues at the recipient mail server.
The RCPT command is used to tell the sender mail server, who the recipient of your message is. The error message denotes that the sending mail server faced an error during that command, while trying to send mails.
SMTP -> ERROR: RCPT not accepted from server: 550 SMTP AUTH is required for message submission on port 587 SMTP -> ERROR: DATA command not accepted from server: SMTP -> NOTICE: EOF caught while checking if connected phpmailer Share Improve this question Follow
SMTP error from remote mail server after RCPT TO:<[email protected]>: host domain.com [xx.xx.xx.xx]: 550-Please turn on SMTP Authentication in your mail client. 550- (host.domain.com) [yy.yy.yy.yy]: __ is not permitted to relay through this server without authentication.
It looks like port 587 is blocked. Try using
$mail= new PHPMailer();
$mail->IsSMTP();
$mail->SMTPAuth= true;
$mail->SMTPSecure= "ssl";
$mail->Host= "smtp.gmail.com";
$mail->Port= 465;.....
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With