简体   繁体   中英

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].

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. Both projects are currently running in the free quota.

When I invoke the common Emailer class from Project A, the email gets sent; 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. I have checked Spam folder/label and even searched entire mailbox for mail from:appspotmail.com (see below) and nothing.

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).

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.

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.

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 . However, manually sending email to this address from within Gmail works, so that shouldn't be an issue.

Update 1

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. 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.

  • Changed sender email to admin@project-name.appspotmail.com (instead of project-id ) and got an Unauthorized sender message in an exception.

    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 . As Emails are delivered asynchronously, any delivery problems will result in a bounce to the specified sender.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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