python - 我收到 Mail Service.Send 消息,但我的邮件没有送达地址

标签 python google-app-engine email

我的ma​​in.py

message = mail.EmailMessage(sender="<ada******@gmail.com>",
                            subject="Your account has been approved")
message.to = "<*****.ada@gmail.com>"
message.body = """
            Please let us know if you have any questions
            """
message.send()

我将 Google App Engine MailService 用于以下控制台输出:

INFO     2015-05-11 17:21:46,179 mail_stub.py:143] MailService.Send
From: <ada******@gmail.com>
To: <*****ada@gmail.com>
Subject: Your account has been approved
Body:
Content-type: text/plain
Data length: 317

但是邮件不会发送到地址 *****.ada@gmail.com。有什么问题?

最佳答案

如果您在开发服务器上,您需要一个邮件服务器才能使用:参见here如何使用 SendmailSMTP 服务器。 但是(底部的 here):

When your application is running on App Engine, it uses the App Engine mail service to send email messages.

因此,即使在开发服务器上您无法发送电子邮件,当您在 App Engine 上部署代码时,它们也会被发送。

关于python - 我收到 Mail Service.Send 消息,但我的邮件没有送达地址,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30174191/

相关文章:

python - 提取单行时如何保留 Pandas 数据框身份

python - 使用 adaboost 的 sklearn 中的特征重要性

python - 属性错误 : 'Index' object has no attribute 'tz_localize' with yfinance

python - Python 中的切片列表混淆

google-app-engine - Google App Engine 与 Tomcat

php - 在 laravel markdown 电子邮件中嵌入图像

google-app-engine - 监控谷歌应用程序引擎日志并发送电子邮件

python - webapp2 和 App Engine 的 SHA 512 密码?

java - 使用 JavaMail Api 在电子邮件中发送阿拉伯字母等外来字符

python - 使用 Unicode 发送 HTML 邮件