Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SMTP -> ERROR: RCPT not accepted from server

Tags:

phpmailer

 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

like image 537
Vinay Avatar asked Mar 16 '13 18:03

Vinay


People also ask

Why do I get SMTP error after RCPT TO?

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.

What is the RCPT command in Linux?

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.

What are the error messages for SMTP port 587?

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

What does SMTP error 550 mean?

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.


1 Answers

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;.....
like image 103
user3711556 Avatar answered Oct 22 '22 15:10

user3711556