SMTP Error: The following recipients failed:XXXX
Asked Answered
C

9

18

So i just received this error when trying to send an mail using PHPmailer from my site.

SMTP Error: The following recipients failed: XXXX

I tried to set $mail->SMTPAuth = true; to false but no result. And i tried to change the password for the mail account and update that in the sendmailfile.php but still the same.

It worked as intended two days ago, now i don't know why this is happening. Since there ain't any error code either i don't really know where to begin and since it did work..

Anyone who might know?

    $mail = new PHPMailer();
    $mail->CharSet = 'UTF-8';
    $mail->ContentType = 'text/html';
    $mail->IsSMTP();
    $mail->Host = "HOST.COM";
    $mail->SMTPAuth = true;
    $mail->Username = "MAIL_TO_SEND_FROM"; 
    $mail->Password = "PASSWORD"; 
    $mail->From = "MAIL_TO_SEND_FROM";
    $mail->FromName = "NAME";
    $mail->AddAddress($safeMail);
    $mail->AddReplyTo("[email protected]", "No-reply");
    $mail->WordWrap = 50;
    $mail->IsHTML(true);
    $sub = "SUBJECT";
    mail->Subject = ($sub);
Crab answered 17/8, 2013 at 11:26 Comment(4)
use something like this to get a more use full error message :phpmailer.worxware.com/index.php?pg=exampleamailKingship
Now i got some more info: SMTP -> ERROR: RCPT not accepted from server: 550-Verification failed for 550-No Such User Here 550 Sender verify failed SMTP Error: The following recipients failed: XXXXCrab
Please get PHPMailer from Github. That site has not been supported for years: github.com/PHPMailer/PHPMailerMarnie
Just as a point to consider. I had encountered the same issue due to the wrong password also.Entozoic
L
18

Maybe your class.phpmailer.php file is corrupt. Download the latest version from : https://github.com/PHPMailer/PHPMailer

$mail->SMTPDebug  = 1; // enables SMTP debug information (for testing)
                               // 1 = errors and messages
                               // 2 = messages only
Langobardic answered 17/8, 2013 at 11:32 Comment(4)
Hopefully that is the case, i'm downloading an newer versio as we speak.Crab
Updated, still the same error.. must be server/mail account related i assume.Crab
Atleast now i know that it is server/mail account related. Time to contact the support at my hosting company then. Thank you for your time! Much appreciated.Crab
The sourceforge project has not been supported for years and contains many bugs - I corrected the download link to PHPMailer's current home. Also there are now more SMTP debug options that might help with this problem.Marnie
E
24

I've encountered the same problem. Managed too fix it when i commented the next row:

 $mail->isSMTP(); 

Noticed you already found an answer, however maybe this will fix the problem for other people.

This does prevent using your external SMTP server as RozzA stated in the comments.

Epic answered 17/4, 2014 at 7:59 Comment(3)
@Jordy, I just upvoted it because it was the only solution that worked for me.Petrel
this prevents using external SMTP and uses localhost FYIOke
@Oke Guess this is exactly what most people need when coding locally.Epic
L
18

Maybe your class.phpmailer.php file is corrupt. Download the latest version from : https://github.com/PHPMailer/PHPMailer

$mail->SMTPDebug  = 1; // enables SMTP debug information (for testing)
                               // 1 = errors and messages
                               // 2 = messages only
Langobardic answered 17/8, 2013 at 11:32 Comment(4)
Hopefully that is the case, i'm downloading an newer versio as we speak.Crab
Updated, still the same error.. must be server/mail account related i assume.Crab
Atleast now i know that it is server/mail account related. Time to contact the support at my hosting company then. Thank you for your time! Much appreciated.Crab
The sourceforge project has not been supported for years and contains many bugs - I corrected the download link to PHPMailer's current home. Also there are now more SMTP debug options that might help with this problem.Marnie
B
3

It is a restriction from your SMTP server. Sending e-mail messages is a vital part of the ever-growing Internet business. Sometimes, a large number of e-mails are required to be sent daily, even hourly. With this comes also the ever-increasing problem with the e-mail spam, and the countless number of junk messages users receive constantly.

The most common restrictions are:

150 e-mails per hour; 1500 e-mails per 24 hours; 50 recipients per message, where each recipient is counted as a separately sent e-mail message (e.g. if you have 50 recipients in a single message, this willcount as 50 sent messages);

One solution is to use a mailing list, then the restriction is 1500 e-mails for 24 hours. There's no restriction for the amount of emails sent per hour, i.e. you can send an email to a mailing list with up to 1500 recipients without a problem.

If you reach the hourly/daily limit you will get this error when trying to send further e-mails: 550 - Stop, you are sending too fast!

You will be able to send e-mails again, once the hour/day has passed.

Things you should know in order to avoid exceeding your limit:

The above e-mail restrictions are valid for the entire hosting account, and not for a single mailbox. This means, that if one of your mailboxes exceeds the allowed limit, you will not be able to send messages from any of your other e-mail accounts. If, at any point you receive the afore-mentioned error message, it is highly recommended to stop all attempts to send messages from your mailboxes. If you continue trying, your messages will be left in a mail queue, which will have to clear first, before the server timer can reset and allow you to send e-mails again.

Boffa answered 1/12, 2016 at 14:50 Comment(2)
Very useful tip. Thank you, Zeke!Dayna
Well, in that case the SMTP server should respond with some other message like "quota exceeded" or similar.Bushtit
T
2

try inlcuding this

$mail->SMTPDebug  = 1;
Throughout answered 17/8, 2013 at 11:37 Comment(7)
That results in the following: SMTP -> ERROR: RCPT not accepted from server: 550-Verification failed for 550-No Such User Here 550 Sender verify failed SMTP Error: The following recipients failed: XXXXXXXCrab
try setting SMTPAuth to falseThroughout
did you try updating your class.phpmailer.php file .maybe your current file is corruptThroughout
Hopefully that is the case. I'm download an newer version as we speak.Crab
check my latest answerThroughout
Atleast now i know that it is server/mail account related. Time to contact the support at my hosting company then. Thank you for your time! Much appreciated.Crab
Great! This showed me the stupid mistake I'd made in setting the "from" address! That's what generated the error, not the recipient address.Aldoaldol
P
2

Just try to set SMTPAuth to false.

Peltz answered 17/8, 2013 at 11:38 Comment(1)
I did, sadly it didn't help.Crab
T
0

there is a slightly less probable problem.maybe this condition is caused by protection placed by your ISP.and you said it worked well two days ago.maybe that is the problem.try contacting your ISP.

or maybe its a problem with the recipients/senders email adresses

Throughout answered 17/8, 2013 at 11:47 Comment(0)
B
0

Here is some additional info about SMTP Auth

PLAIN (Uses Base64 encoding.) LOGIN (Uses Base64 encoding.) e.t.c - you can watch here http://en.wikipedia.org/wiki/SMTP_Authentication

For me solution was to set SMTPAuth to true for PHPMailer class

Bushido answered 12/3, 2014 at 12:3 Comment(0)
C
0

Please note in your lines i.e....

$mail->Username = "MAIL_TO_SEND_FROM"; $mail->Password = "PASSWORD"; $mail->From = "MAIL_TO_SEND_FROM";

Here at Line 1 and 3 you have to use same email address (You can't use different email address), this will work sure, I hope u r using different email address, (Email address must be same as username/password matching).

Customable answered 4/1, 2019 at 10:23 Comment(0)
S
0

for Skip sending emails to invalid adresses; use try ... catch

$mail=new PHPMailer(true);
try {
$mail->CharSet = 'utf-8';  
$mail->isSMTP();
$mail->isHTML(true);
$mail->Host = 'smtp.yourhost.com';
$mail->Port = 25;
$mail->SMTPAuth = false;
$mail->Username = 'xxxx';
$mail->Password = 'xxxx';
$mail->SMTPSecure = 'tls';
$mail->SMTPDebug = 0;
$mail->MailerDebug = false;
$mail->setFrom($absender, $name);
$mail->addAddress($to);
$mail->Subject = $subject;
$mail->Body = $message_other_player;
}

$mail->send();
      // echo 'Message has been sent';
   } catch (Exception $e) {
     //  echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
   }

PHPMailer - Skip sending emails to invalid adresses

Spacial answered 6/5, 2021 at 18:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.