Google App Engine sending mail
我有一个域 www.MYDOMAIN.com ,并且 www.MYDOMAIN.com 的电子邮件托管在 Yahoo Business 中。我有一个名为 xyz.appspot.com 的 Google App Engine 项目。我想从我的应用引擎项目发送电子邮件,但来自 [email protected]。
是否可以在不将主机从 yahoo 移动到 google 的情况下做到这一点?我可以从 [email protected] 向 [email protected] 发送电子邮件吗?
我没有在 Google 以外的域上完成此操作,但根据此:
The email address of the sender, the From address. The sender address
must be one of the following types:-The address of a registered administrator for the application. You can
add administrators to an application using the Administration Console.-The address of the user for the current request signed in with a
Google Account. You can determine the current user's email address
with the Users API. The user's account must be a Gmail account, or be
on a domain managed by Google Apps.-Any valid email receiving address
for the app (such as [email protected]).-Any valid email receiving address of a domain account, such as [email protected]. Domain accounts are accounts outside of the Google domain with email
addresses that do not end in @gmail.com or @APP-ID.appspotmail.com.
您应该能够将"[email protected]"添加为管理员并发送邮件。如果您需要从多个发送,您应该能够向 Google 注册域。检查这里和这里。
如果可行,最简单的解决方案是 Ryan 指出的 - 添加"[email protected]"作为应用程序管理员(转到该应用程序的开发人员控制台中的权限并添加该电子邮件,然后使用生成的电子邮件链接确认)。但是,请记住,您需要为"[email protected]"设置一个谷歌帐户,您可以在以该用户身份登录时接收电子邮件并点击链接(可能需要使用私人/隐身窗口如果您以不同的用户身份登录控制台)。
如果这种方法在您的情况下不起作用(您无权访问 [email protected] 或者您无法使用该电子邮件地址创建 google 帐户),阻力最小的路径可能是使用第三方系统,例如 SendGrid。您可以在 https://cloud.google.com/appengine/docs/python/mail/sendgrid 查看有关将 SendGrid 与 GAE 结合使用的信息。
我们发现这是一种更灵活、更简单的方法(一旦您第一次这样做),因为在我们的情况下,为每个"发件人"地址创建、验证和更新应用程序权限的要求过于繁琐。