简体   繁体   English

连接正确时,用PHP Mailer发送的邮件会自动发送吗?

[英]Do mails sent with PHP Mailer send automatically when the connection is correct?

I would like to ask what happens if the PHP Mailer library fails to send an email via SMTP. 我想问一下,如果PHP Mailer库无法通过SMTP发送电子邮件,会发生什么情况。 The service connects to the SMTP server but emails are not send at all. 该服务已连接到SMTP服务器,但根本不发送电子邮件。 Do these email go to some kind of queue and are send when the problem is solved or will I have to resend them once more from the code? 这些电子邮件是否会排入某种队列,并在问题解决后发送?还是我必须从代​​码中重新发送一次?

Thanks in advance for help. 在此先感谢您的帮助。

As far as PHPMailer is concerned, messages are either sent or they are not; 就PHPMailer而言,消息要么发送,要么不发送; it does no queuing of its own because it's not a mail server. 它不是自己的队列,因为它不是邮件服务器。 Set $mail->SMTPDebug = 2; 设置$mail->SMTPDebug = 2; to see the whole conversation with your mail server. 查看与邮件服务器的整个对话。 It may be that your mail server does queue, and may take a while to deal with onward delivery, but that's beyond the control of PHPMailer. 可能是您的邮件服务器确实在排队,并且可能需要一些时间来处理继续传递,但这超出了PHPMailer的控制范围。 Your mail server logs (if you have access to them) will also tell you what it's doing. 您的邮件服务器日志(如果您有权访问它们)还将告诉您它在做什么。 All of this is covered in the PHPMaielr docs. 所有这些都在PHPMaielr文档中进行了介绍。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM