views:

72

answers:

1

my gmail is [email protected]

i can only use [email protected] in the sender=".." ,yes ??

from google.appengine.api import mail

    message = mail.EmailMessage(sender="[email protected]",
                                subject="Your account has been approved")

    message.to = "[email protected]"
    message.body = """
    Dear Albert:

    Your example.com account has been approved.  You can now visit
    http://www.example.com/ and sign in using your Google Account to
    access new features.

    Please let us know if you have any questions.

    The example.com Team
    """

    message.send()

thanks

+3  A: 

There are two kinds of FROM addresses allowed by GAE's e-mail API:

  • The currently authenticated Google user of your app (if your app uses Google auth and someone's logged in)
  • The Google address of any administrator of the app engine app (e.g. you, as the owner)

"If you want to send email on behalf of the application but do not want to use a single administrator's personal Google Account as the sender, you can create a new Google Account for the application using any valid email address, then add the new account as an administrator for the application. To add an account as an administrator, see the "Developers" section of the Admin Console."

http://code.google.com/appengine/docs/java/mail/overview.html

Bosh