是google-app-engine的发件人允许我自己的Gmail

是google-app-engine的发件人允许我自己的Gmail

问题描述:

我的Gmail是zjm1126@gmail.com

my gmail is zjm1126@gmail.com

我只能在发件人=..中使用zjm1126@gmail.com,是的

i can only use zjm1126@gmail.com in the sender=".." ,yes ??

from google.appengine.api import mail

    message = mail.EmailMessage(sender="hahahaha@gmail.com",
                                subject="Your account has been approved")

    message.to = "zjm1126@qq.com"
    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()

谢谢

GAE的电子邮件API允许有两种FROM地址:

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


  • 目前您应用程式的Google认证用户(如果您的应用程式)使用Google认证和某人登录)

  • 应用引擎应用的任何管理员的Google地址(例如,您,作为所有者)

如果您要代表应用程序发送电子邮件,但不想使用单个管理员个人Google帐户作为发件人,您可以使用任何有效的电子邮件地址为应用程序创建一个新的Google帐户,然后以该应用程序的管理员身份添加新帐户。要以管理员身份添加帐户,请参阅开发人员部分管理控制台。

"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