【问题标题】:Only one mail to one domain一个域只发一封邮件
【发布时间】:2013-10-01 22:38:26
【问题描述】:

为什么如果我从 PHP 向具有相同域的两个人发送邮件,那么邮件不会发送? 例如,如果我使用 PHPMailer(在其他类中我有相同的错误):

$mail->addAddress('whoto1@example1.com', 'John Doe1');
$mail->addAddress('whoto2@example2.com', 'John Doe2');
$mail->addAddress('whoto3@example3.com', 'John Doe3');
$mail->Send();

这工作正常 - 所有收到这些邮件的人都会收到它们。但如果我有:

$mail->addAddress('whoto1@example1.com', 'John Doe1');
$mail->addAddress('whoto2@example2.com', 'John Doe2');
$mail->addAddress('whoto3@example3.com', 'John Doe3');
$mail->Send();

然后所有邮件都会被投递。

如果:

$mail->addAddress('whoto1@example1.com', 'John Doe1');
$mail->Send();
$mail->addAddress('whoto2@example2.com', 'John Doe2');
$mail->Send();
$mail->addAddress('whoto3@example3.com', 'John Doe3');
$mail->Send();

然后工作得很好。

我在哪里可以找到解决方案?我想分一部分发送邮件,与示例 2 相同。为什么这在我的服务器上不起作用?

【问题讨论】:

  • 第一个和第二个代码sn-p有什么区别?它们是相同的,没有理由为什么一个应该工作而另一个不工作。

标签: php apache email smtp phpmailer


【解决方案1】:

您可以设置一组联系人以发送电子邮件,然后将其全部邮寄。例如

for(x = 0; x < array.length; x++){
$address[x] ... do whatever with address
$name[x] ... do whatever with name
use a send mail function to email each person individuly
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-09-13
    • 1970-01-01
    • 2014-12-14
    • 1970-01-01
    • 2015-02-06
    • 2019-04-03
    • 1970-01-01
    相关资源
    最近更新 更多