17

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("no-reply@example.COM", "No-reply");
    $mail->WordWrap = 50;
    $mail->IsHTML(true);
    $sub = "SUBJECT";
    mail->Subject = ($sub);
Kenster
  • 18,710
  • 21
  • 68
  • 90
Markus
  • 586
  • 1
  • 8
  • 23
  • use something like this to get a more use full error message :http://phpmailer.worxware.com/index.php?pg=exampleamail –  Aug 17 '13 at 11:33
  • 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: XXXX – Markus Aug 17 '13 at 11:41
  • Please get PHPMailer from Github. That site has not been supported for years: https://github.com/PHPMailer/PHPMailer – Synchro Apr 24 '14 at 09:01
  • Just as a point to consider. I had encountered the same issue due to the wrong password also. – Varshaan Sep 08 '18 at 12:31

9 Answers9

22

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.

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
Synchro
  • 29,823
  • 14
  • 69
  • 85
chirag ode
  • 965
  • 7
  • 15
  • Hopefully that is the case, i'm downloading an newer versio as we speak. – Markus Aug 17 '13 at 11:46
  • Updated, still the same error.. must be server/mail account related i assume. – Markus Aug 17 '13 at 11:59
  • 1
    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. – Markus Aug 17 '13 at 12:04
  • 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. – Synchro Apr 24 '14 at 09:03
2

try inlcuding this

$mail->SMTPDebug  = 1;
2

Just try to set SMTPAuth to false.

Manish Chauhan
  • 545
  • 2
  • 7
  • 14
2

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.

Zeke
  • 382
  • 2
  • 11
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

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

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).

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

Alex
  • 43
  • 6