I am using GMail SMTP server to send mails. And PHPMailer as the mail sending script.
我正在使用GMail SMTP服务器发送邮件。而PHPMailer作为邮件发送脚本。
I have received this error (I log all SMTP errors, that is whenever, PHPMailer::Send fails): -
我收到此错误(我记录所有SMTP错误,即每当PHPMailer :: Send失败): -
SMTP Error: Data not accepted.<p>SMTP server error: 4.7.0 Temporary System Problem. Try again later (WS)
But the mails is actually sent. (This I know by matching the timestamp of sent mails, and the timestamp in the log.)
但邮件实际上是发送的。 (我知道通过匹配发送邮件的时间戳和日志中的时间戳。)
How is it possible? What does that error mean?
这怎么可能?这个错误意味着什么?
UPDATE: I think I was not clear in my question. Let me rephrase it: -
更新:我想我的问题并不清楚。让我重新说一下: -
I am not worried if a mail is lost after PHPMailer is able to send it to GMail SMTP. But I am worried that PHPMailer has returned error, but the mail was sent. Is it possible?
在PHPMailer能够将邮件发送到GMail SMTP后,我不担心邮件是否丢失。但我担心PHPMailer返回错误,但邮件已发送。可能吗?
1 个解决方案
#1
I think that SMTP does not guarantee delivery anyway. It is a store-and-forward mechanism. That is why some emails can go missing (for e.g. if a relay crashed while in the midst of relaying the message).
我认为SMTP无论如何都不保证交付。它是一种存储转发机制。这就是为什么有些电子邮件可能会丢失的原因(例如,如果在转发消息的过程中继电器崩溃)。
If you are depending on email for important functions, you may want to enforce some sort of feed-back mechanism (maybe via a response). Then, if a response is not received within a certain time frame, you try it again.
如果您依赖于重要功能的电子邮件,您可能希望强制执行某种反馈机制(可能通过响应)。然后,如果在特定时间范围内未收到回复,则再次尝试。
UPDATE: It is most certainly possible. All you need is a mail server that sends you an error code instead. It may send an error code for a variety of reasons, too many to list. I suggested the above method because, you should never take server responses on trust alone, especially if it does not any sort of atomicity/acidity.
更新:这当然是可能的。您所需要的只是一个邮件服务器,它会向您发送错误代码。它可能由于各种原因发送错误代码,列出太多。我建议使用上面的方法,因为你不应该单独依赖服务器响应,特别是如果它没有任何原子性/酸度。
#1
I think that SMTP does not guarantee delivery anyway. It is a store-and-forward mechanism. That is why some emails can go missing (for e.g. if a relay crashed while in the midst of relaying the message).
我认为SMTP无论如何都不保证交付。它是一种存储转发机制。这就是为什么有些电子邮件可能会丢失的原因(例如,如果在转发消息的过程中继电器崩溃)。
If you are depending on email for important functions, you may want to enforce some sort of feed-back mechanism (maybe via a response). Then, if a response is not received within a certain time frame, you try it again.
如果您依赖于重要功能的电子邮件,您可能希望强制执行某种反馈机制(可能通过响应)。然后,如果在特定时间范围内未收到回复,则再次尝试。
UPDATE: It is most certainly possible. All you need is a mail server that sends you an error code instead. It may send an error code for a variety of reasons, too many to list. I suggested the above method because, you should never take server responses on trust alone, especially if it does not any sort of atomicity/acidity.
更新:这当然是可能的。您所需要的只是一个邮件服务器,它会向您发送错误代码。它可能由于各种原因发送错误代码,列出太多。我建议使用上面的方法,因为你不应该单独依赖服务器响应,特别是如果它没有任何原子性/酸度。