简体   繁体   English

最好在google-app-engine上发送邮件

[英]which is better to send mail on google-app-engine

this: http://code.google.com/intl/en/appengine/docs/python/tools/devserver.html 这个: http : //code.google.com/intl/zh-CN/appengine/docs/python/tools/devserver.html

The web server can use an SMTP server, or it can use a local installation of Sendmail.

i download the Sendmail lib,and find it is so big, and so many doc, 我下载了Sendmail库,发现它很大,而且文档太多,

i want to know which way is better, 我想知道哪种方法更好

and if the Sendmail way is better, how to use it simplely, 如果使用Sendmail方法更好,如何简单地使用它,

thanks 谢谢

updated: 更新:

if can't setup the sendmail lib,can't use this method (mail.send_mail) ,yes?: 如果无法设置sendmail库,则不能使用此方法(mail.send_mail),是吗?

from google.appengine.api import mail

mail.send_mail(sender="support@example.com",
              to="Albert Johnson <Albert.Johnson@example.com>",
              subject="Your account has been approved",
              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
""")

As Wooble points out, this only applies to sending email from the development environment - so pick whichever option is easiest. 正如Wooble指出的那样,这仅适用于从开发环境发送电子邮件-因此,请选择最简单的选项。 If you can't get any of them working, email sent on the development server will still show up in your logs, so you can debug it there. 如果您无法使它们正常工作,则开发服务器上发送的电子邮件仍会显示在您的日志中,因此您可以在其中进行调试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM