Worldcrafter
Worldcrafter

Reputation: 35

Google app engine send mail raises ApplicationError: 1 Internal Error

Years back I built a simple mail form that has been working like a champ, but in the last couple months the logs show I'm getting an error when EmailMessage's send() method gets called.

I wrote a quick test to see if a stripped down version of an EmailMessage would work without error:

class TestEmail(webapp.RequestHandler):
  def get(self):
    fromAddress = "[email protected]"
    email = mail.EmailMessage(sender=fromAddress)
    email.to = self.request.get('to') + '@gmail.com' 
    email.subject = "Test Email"
    email.body = "Testing the email system"
    email.html = "<strong>Testing the <em>email</em> system</strong>"
    email.check_initialized()
    email.send() 

Simple enough, but if I call that with:

http://MYAPPNAME.appspot.com/test-email?to=TOTALLYLEGITEMAIL

I still get the same error (note check_initialized() isn't throwing an error):

Traceback (most recent call last):
File "/base/python_runtime/python_lib/versions/1/google/appengine/ext/webapp/_webapp25.py", line 701, in __call__
handler.get(*groups)
File "/base/data/home/apps/s~myappname/3.354527616249361817/myappname.py", line 370, in get
email.send()
File "/base/python_runtime/python_lib/versions/1/google/appengine/api/mail.py", line 895, in send
raise e
ApplicationError: ApplicationError: 1 Internal error

I haven't made any recent changes to the app, it's a lightly used app well below quota, it's sending as the email associated with the app owner and after spending a few hours scrutinizing the code, I'm still no closer to an answer.

Even more distressing, every Google search I come up with offers no new help. The best I could find was this question: Google app engine send mail service raises exception which sounds exactly like my problem, but in that case there wasn't a solution, the problem just went away.

Any idea how I can track this one down? Let me know if I need to clarify anything. Thanks!

Upvotes: 1

Views: 474

Answers (1)

Moishe Lettvin
Moishe Lettvin

Reputation: 8471

What is your appid?

There is currently an issue that sending mail from an application whose appid is the same as the owner's gmail name will fail. eg, I have a gmail address "moishel at gmail dot com"; if I created an app whose appid is 'moishel' (before version 1.6.0) it will fail when trying to send mail. Note that this problem does not exist for apps created with version 1.6.0 or after.

Here's the issue: http://code.google.com/p/googleappengine/issues/detail?id=5320

Upvotes: 2

Related Questions