1
votes

My application was working ok for almost a year now, but suddenly it can't send emails. There are no exceptions raised, everything seems ok, but the mails are not delivered I've checked the entire mailbox, spam folders and everything. Here is the sending code:

mail.send_mail(sender="[email protected]",  #this is my email, I am the admin
               to=email,
               subject="Account verification",
               body=emailContentsTXT)

The call returns successfully, no exceptions are thrown. The number of sent emails in the Quotas dashboard gets increased when I try to send the email.

2

2 Answers

1
votes

The lack of errors and the incrementing of the sent emails in the Quotas indicate that message sending works fine.

The only way to determine why the messages are not reaching the destination is to check the bounced emails. Your app needs to be configured to receive and handle the bounced emails:

To configure your app to receive bounced email notifications:

1.Add the following to your app.yaml file to enable notification:

inbound_services:
- mail_bounce

2.Also in app.yaml, declare a mapping between /_ah/bounce and the bounce notification handler in your code, for example:

- url: /_ah/bounce
  script: handle_bounced_email.app
  login: admin

The mentioned doc contains examples of possible bounced message handlers as well.

Update: After the OP's observation that the issue seems caused by a URL (to an appspot.com domain) inside the email I noticed this GAE issue (still open and with quite recent activity) which appears a perfect match.

1
votes

There's a thread on Hacker News about this. Evidently anti-spam measures by Google have been silently deleting email sent from AppEngine.

A Google Engineer says that they're working with people on a case-by-case basis so if you're having a problem, you should probably contact their support.