php SMTP 错误:以下收件人失败:XXXX
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18288254/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
SMTP Error: The following recipients failed:XXXX
提问by Markus
So i just received this error when trying to send an mail using PHPmailer from my site.
因此,当我尝试使用 PHPmailer 从我的站点发送邮件时,我刚刚收到此错误。
SMTP Error: The following recipients failed: XXXX
SMTP 错误:以下收件人失败: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.
我试图设置 $mail->SMTPAuth = true; 为假但没有结果。我尝试更改邮件帐户的密码并在 sendmailfile.php 中更新该密码,但仍然相同。
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);
回答by
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.
这确实会阻止使用您的外部 SMTP 服务器,如 RozzA 在评论中所述。
回答by chirag ode
Maybe your class.phpmailer.php file is corrupt. Download the latest version from : https://github.com/PHPMailer/PHPMailer
也许您的 class.phpmailer.php 文件已损坏。从以下位置下载最新版本:https: //github.com/PHPMailer/PHPMailer
$mail->SMTPDebug = 1; // enables SMTP debug information (for testing)
// 1 = errors and messages
// 2 = messages only
回答by Vihanga Gamage
try inlcuding this
尝试包括这个
$mail->SMTPDebug = 1;
回答by Manish Chauhan
Just try to set SMTPAuth to false.
只需尝试将 SMTPAuth 设置为 false。
回答by Zeke
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.
这是您的 SMTP 服务器的限制。发送电子邮件是不断增长的 Internet 业务的重要组成部分。有时,需要每天甚至每小时发送大量电子邮件。随之而来的还有垃圾邮件日益严重的问题,以及用户不断收到的无数垃圾邮件。
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);
每小时 150 封电子邮件;每 24 小时 1500 封电子邮件;每封邮件 50 个收件人,其中每个收件人都被计为单独发送的电子邮件(例如,如果您在一封邮件中有 50 个收件人,这将计为 50 封已发送邮件);
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.
一种解决方案是使用邮件列表,然后限制是 24 小时内 1500 封电子邮件。每小时发送的电子邮件数量没有限制,即您可以毫无问题地将电子邮件发送到最多 1500 个收件人的邮件列表。
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!
如果您达到每小时/每天的限制,您将在尝试发送更多电子邮件时收到此错误:550 - 停止,您发送得太快了!
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.
上述电子邮件限制对整个主机帐户有效,不适用于单个邮箱。这意味着,如果您的一个邮箱超过了允许的限制,您将无法从任何其他电子邮件帐户发送邮件。如果您在任何时候收到上述错误消息,强烈建议停止从您的邮箱发送消息的所有尝试。如果您继续尝试,您的邮件将留在邮件队列中,必须先清除邮件队列,然后服务器计时器才能重置并允许您再次发送电子邮件。
回答by Saif Warsi
Please note in your lines i.e....
请注意您的行,即...
$mail->Username = "MAIL_TO_SEND_FROM";
$mail->Password = "PASSWORD";
$mail->From = "MAIL_TO_SEND_FROM";
$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).
在第 1 行和第 3 行,您必须使用相同的电子邮件地址(您不能使用不同的电子邮件地址),这肯定会起作用,我希望您使用不同的电子邮件地址,(电子邮件地址必须与用户名/密码匹配相同)。
回答by Vihanga Gamage
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.
有一个不太可能的问题。也许这种情况是由您的 ISP 提供的保护引起的。您两天前说它运行良好。也许这就是问题所在。请尝试联系您的 ISP。
or maybe its a problem with the recipients/senders email adresses
或者可能是收件人/发件人的电子邮件地址有问题
回答by Belikov Dmitrii
Here is some additional info about SMTP Auth
以下是有关 SMTP 身份验证的一些附加信息
PLAIN (Uses Base64 encoding.) LOGIN (Uses Base64 encoding.) e.t.c - you can watch here http://en.wikipedia.org/wiki/SMTP_Authentication
PLAIN(使用 Base64 编码。)LOGIN(使用 Base64 编码。)等 - 你可以在这里观看http://en.wikipedia.org/wiki/SMTP_Authentication
For me solution was to set SMTPAuth to true for PHPMailer class
对我来说,解决方案是将 PHPMailer 类的 SMTPAuth 设置为 true