[英]Email sending isn't working on Google App Engine though no errors in logs
[I have looked at all the questions related to this topic on SO but neither of them seems to explain the behaviour I am seeing]. [我在SO上查看了与此主题相关的所有问题,但它们似乎都没有解释我所看到的行为]。
I have two projects A (3-4 months old) and B (0.5 month old) and both use a common class to send email on Google App Engine. 我有两个项目A(3-4个月大)和B(0.5个月大),两个项目都使用通用课程在Google App Engine上发送电子邮件。 Both projects are currently running in the free quota.
这两个项目目前都在免费配额中运行。
When I invoke the common Emailer
class from Project A, the email gets sent; 当我从项目A调用公共
Emailer
类时,会发送电子邮件; invoking from B does not produce any errors in the log file (the logs show correct information in email fields), but the email never arrives at the recipient address. 从B调用不会在日志文件中产生任何错误(日志在电子邮件字段中显示正确的信息),但电子邮件永远不会到达收件人地址。 I have checked Spam folder/label and even searched entire mailbox for mail
from:appspotmail.com
(see below) and nothing. 我检查了垃圾邮件文件夹/标签,甚至搜索整个邮箱的邮件
from:appspotmail.com
(见下文),什么都没有。
I have verified that for each email sent, the email quota on Developer Console (at console.cloud.google.com/appengine/quotadetails?project= project-b &moduleId=default) registers another recipient, so obviously Google code is being invoked correctly (the email in question is for the reset password, so has only recipient). 我已经确认,对于发送的每封电子邮件,开发者控制台上的电子邮件配额(在console.cloud.google.com/appengine/quotadetails?project= project -b &moduleId = default)会注册另一个收件人,因此显然正在正确调用Google代码(有问题的电子邮件是重置密码,因此只有收件人)。
I tried sending as admin@mydomain.com
( admin@mydomain.com
has been added to list of Email API authorized senders on the settings page of app B) and also as admin@project-b.appspotmail.com
and neither one works. 我尝试发送为
admin@mydomain.com
( admin@mydomain.com
已添加到应用B的设置页面上的Email API授权发件人列表),也作为admin@project-b.appspotmail.com
,但admin@project-b.appspotmail.com
。
On project A so far I have always sent email as admin@project-a.appspotmail.com
(where project-a
is the id of my GAE app) and have never faced any issue of this sort. 到目前为止,在项目A上,我总是发送电子邮件为
admin@project-a.appspotmail.com
(其中project-a
是我的GAE应用程序的ID),并且从未遇到任何此类问题。
What is going on here? 这里发生了什么? Is there some additional setting I am missing out on?
我错过了一些额外的设置吗?
NB: This probably doesn't have any bearing, but mentioning in the interests of completeness: the recipient email address is of the form myaccount+xyz@gmail.com
instead of the more common myaccount@gmail.com
. 注意:这可能没有任何影响,但为了完整性而提及:收件人电子邮件地址的格式为
myaccount+xyz@gmail.com
而不是更常见的myaccount@gmail.com
。 However, manually sending email to this address from within Gmail works, so that shouldn't be an issue. 但是,从Gmail中手动向此地址发送电子邮件是有效的,因此这不应成为问题。
Based on suggestions here and things that I've tried since posting this question, here are some updates: 基于此处的建议以及自发布此问题以来我尝试过的内容,以下是一些更新:
I set up an email bounce handler as suggested but it hasn't been invoked yet (as per the logs). 我按照建议设置了一个电子邮件退回处理程序,但尚未调用(根据日志)。
Maybe it'll be invoked after waiting 24-48 hours. 也许它会在等待24-48小时后被调用。 Let's see.
让我们来看看。
Set up account with email simplename@gmail.com
and exactly the same thing (ie, nothing) happened when I invoked Forgot password functionality. 使用电子邮件
simplename@gmail.com
设置帐户,并在调用忘记密码功能时完全相同(即,没有)。
Changed sender email to admin@project-name.appspotmail.com
(instead of project-id
) and got an Unauthorized sender message in an exception. 将发件人电子邮件更改为
admin@project-name.appspotmail.com
(而不是project-id
),并在异常中收到未经授权的发件人邮件。
This means that the other addresses I have tried have been authorized senders as I never saw this exception with them. 这意味着我尝试过的其他地址都是授权发件人,因为我从来没有看到过它们的例外情况。
The best way to troubleshoot App Engine Email delivery problems is to Configure Email Bounce Notification . 解决App Engine电子邮件传递问题的最佳方法是配置电子邮件退回通知 。 As Emails are delivered asynchronously, any delivery problems will result in a bounce to the specified sender.
由于电子邮件是异步传递的,因此任何传递问题都会导致指定发件人退回。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.