Tim Cobra
Tim Cobra

Reputation: 131

Email from Google App Engine doesn't arrive

I have been using the Email Sender (Java) in my GAE as described here and it works fine: https://cloud.google.com/appengine/docs/java/mail/usingjavamail

I have cloned my project to a 2nd App engine (different branding, etc.) and suddenly the Email being sent doesn't arrive (yes, I've checked spam folders :-)

I created the new GAE and uploaded the code with no changes to my Email class. I added the sender email ([email protected]) to the Email API authorized senders list and they are also an Admin on the project. I get no errors or exceptions from the java code, and it says the email has been sent fine, but it never arrives. I even changed the email address to something random and I correctly received the following exception:

<stderr>: javax.mail.SendFailedException: Send failure (javax.mail.MessagingException: Illegal Arguments (java.lang.IllegalArgumentException: Unauthorized Sender: Unauthorized sender))

The code works in one project, but not the other. What am I missing? Do I need to add an API?

Thank you. Tim

Upvotes: 1

Views: 223

Answers (2)

Tim Cobra
Tim Cobra

Reputation: 131

Well it now works!

I raised the issue with Google on the back of their Issue 12786: Emails appear sent - outside world disagrees and pointed out that their spam filter was being a little too aggressive. How can an app send emails with links back to the xxx.appspot.com if the spam filter is blocking them.

Tested it again this morning and it works Thanks Google (aka Chris)!

Upvotes: 0

Akli REGUIG
Akli REGUIG

Reputation: 562

Does your sender email address fit the following :

For security purposes, the sender address of a message must be one of the following:

  • The Gmail or Google Apps Account of the user who is currently signedin
  • Any email address of the form [email protected] or [email protected]
  • Any email address listed in the Cloud Platform Console under Email API Authorized Senders

source : https://cloud.google.com/appengine/docs/python/mail/

According to your question : just check if the sender email is in App Engine > Settings > Email API authorized senders

Upvotes: 1

Related Questions