I was trying to use the app engine mail sending service on my site. Currently, I've put something as simple as:
message = mail.EmailMessage(sender="Subhranath Chunder <subhranath@gmail.com>", \
subject="Your account has been approved")
message.to = "Subhranath Chunder <subhranathc@yahoo.com>"
message.body = "Just another message"
message.send()
But every time the code handler raises this error:
2011-08-20 04:44:36.988
ApplicationError: 1 Internal error
Traceback (most recent call last):
File "/base/python_runtime/python_lib/versions/1/google/appengine/ext/webapp/_webapp25.py", line 703, in __call__
handler.post(*groups)
File "/base/data/home/apps/s~subhranath/0-2.352669327317975990/index.py", line 71, in post
message.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
My code as a different version, and not the default one. I'm not able to change this version as the default version, unless this error gets resolved. Any idea why this is happening?
Seems to be a app engine system glitch. The same code is now working, without any new deployment.
The sender must either have privilegies or be the logged in user. So subhranath@gmail.com should have admin rights to your location or be the logged in user to run your code.
Most basic example would be just a HTTP get to send an email:
If you want to send an email as the logged in user you can make the sender a variable:
I think the error message you posted was not very clear and if it persists I recommend to get more info about the error message using logging and exceptions.