Sending Mail from Google App Engine
Question: I am trying to send an email from google app engine using the python 2.7
library but I keep getting Unauthorized sender in the logs. I have tried my
gmail account I created the application with as the sender, I registered
another gmail address as a developer and tried that but still get Unauthorized
sender. I am not sure if it matters but I do have a domain name registered to
this application.

Here is the code I am trying:

    
    
    message = mail.EmailMessage()
            message.sender = "ron.....@gmail.com"
            message.subject = "Inquiry"
            message.to = "ron.....@gmail.com"
            message.body = "Please work"
            message.send()
    

I have looked at other articles to no avail.

[Google Appengine sending emails: [Error] unauthorized
sender](http://stackoverflow.com/questions/11621019/google-appengine-sending-
emails-error-unauthorized-sender)

[InvalidSenderError: Unauthorized sender (Google App
Engine)](http://stackoverflow.com/questions/4217972/invalidsendererror-
unauthorized-sender-google-app-engine)


Answer: 
    from google.appengine.api import mail
    
    mail.send_mail(sender="stackoverflow.com Hossam <Hossam@stackoverflow.com>",
                  to="rsnyder <rsnyder@stackoverflow.com>",
                  subject="How to send an e-mail using google app engine",
                  body="""
    Dear rsnyder:
    
    This example shows how to send an e-mail using google app engine
    
    Please let me know if this is what you want.
    
    Best regards,
    """)
    

EDIT:

Note that `sender` must be an `administrator` of the application, so in case
that you are not and `administrator`, follow these steps from the post [google
app engine: how to add adminstrator
account](http://stackoverflow.com/questions/14020317/google-app-engine-how-to-
add-adminstrator-account)

