问题描述
我正在通过Gmail API发送邮件.特别是,我尝试在大约2秒内将5-7封来自同一帐户的电子邮件发送给不同的用户(每封电子邮件1个).
I'm sending messages via the Gmail API. In particular, I am trying to send 5-7 emails from the same account to different users (1 each) within about 2 seconds.
其中大约8%的电子邮件因以下错误而失败:
About 8% of those emails are failing with this error:
&googleapi.Error{
Code:500,
Message:"Backend Error", Body:`{
"error": {
"errors": [
{
"domain": "global",
"reason": "backendError",
"message": "Backend Error"
}
],
"code": 500,
"message": "Backend Error"
}
}`,
Header:http.Header(nil),
Errors:[]googleapi.ErrorItem{
googleapi.ErrorItem{Reason:"backendError", Message:"Backend Error"}
}
}
这似乎不是特定于特定帐户的,因为6/7电子邮件可能会成功.
It doesn't seem like it's specific to a particular account, as 6/7 emails may succeed.
由于担心会向同一个人发送2封电子邮件,我很想重试此操作.
I'm hesitant to retry this for fear of sending 2 emails to the same person.
有什么办法可以告诉您此消息是否可以安全重试?
Is there any way to tell whether this message is safe to retry?
推荐答案
有时它可能在发送之前发生,有时可能在发送之后发生.
Sometimes it can happen before send and sometimes after send.
我记录了五次不同的电子邮件尝试的收件人"和发件人",这些尝试均收到500后端错误.这些尝试均未到达收件箱的已发送"文件夹.我得出的结论是,它们从未发送过,因此重试这些消息是安全的.但是,评论中的其他人(请参阅下文)指出,消息实际上是到达远程邮箱的,因此重试并不安全.
I logged the "To" and "From" from five different email attempts that all received a 500 Backend Error. None of these attempts made it to the "Sent" folder of my inbox. I conclude that they were never sent, and it's safe to retry these messages. However, other people in the comments (see below) indicated that the messages actually made it to the remote mailbox, and it's not safe to retry.
这篇关于"500后端错误";使用Gmail API-是否可以重试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!