Google应用引擎发送邮件引发ApplicationError:1内部错误

时间:2011-11-08 02:59:18

标签: python google-app-engine

多年前我构建了一个简单的邮件表单,它一直像冠军一样工作,但在过去的几个月中,日志显示我在调用EmailMessage的send()方法时遇到错误。

我写了一个快速测试,看看一个精简版的EmailMessage是否可以正常运行:

class TestEmail(webapp.RequestHandler):
  def get(self):
    fromAddress = "APPOWNEREMAIL@gmail.com"
    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() 

很简单,但如果我用:

来称呼它
http://MYAPPNAME.appspot.com/test-email?to=TOTALLYLEGITEMAIL

我仍然得到相同的错误(注意check_initialized()没有抛出错误):

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

我最近没有对应用程序进行任何更改,这是一个远远低于配额的轻微使用的应用程序,它作为与应用程序所有者关联的电子邮件发送,并且花了几个小时仔细检查代码后,我仍然没有更接近回答。

更令人痛苦的是,我提出的每一次Google搜索都没有提供新的帮助。我能找到的最好的是这个问题:Google app engine send mail service raises exception听起来和我的问题完全一样,但在那种情况下没有解决方案,问题就消失了。

知道如何跟踪这个吗?如果我需要澄清任何事情,请告诉我。谢谢!

1 个答案:

答案 0 :(得分:2)

你的appid是什么?

目前存在一个问题,即从appid与所有者的gmail名称相同的应用程序发送邮件将失败。例如,我有一个gmail地址“moishel at gmail dot com”;如果我创建了一个appid为'moishel'的应用程序(版本1.6.0之前),它将在尝试发送邮件时失败。请注意,使用1.6.0版或之后创建的应用程序不存在此问题。

问题在于:http://code.google.com/p/googleappengine/issues/detail?id=5320