如何在没有外部SMTP服务器的情况下发送电子邮件? [英] How to send E-mail without an external SMTP server ?

查看:197
本文介绍了如何在没有外部SMTP服务器的情况下发送电子邮件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我只想在python中发送一封非常简单的电子邮件。


我认为smtpd的标准模块python可以做到这一点,但是我没有找到关于google后如何使用它的文件。是否

使用smtpd的任何例子?我不是专家,所以我需要一些例子

来学习如何使用它。


或许还有更好的方法来实现这个目标?


谢谢。


xiaojf

Hi,

I just want to send a very simple email from within python.

I think the standard module of smtpd in python can do this, but I
haven''t found documents about how to use it after googleing. Are there
any examples of using smtpd ? I''m not an expert,so I need some examples
to learn how to use it.

Or maybe there is a better way to to this?

Thanks.

xiaojf

推荐答案


fd********@gmail.com 写道:




我只想在python中发送一封非常简单的电子邮件。


我认为python中smtpd的标准模块可以做到这一点,但是我没有找到关于google后如何使用它的文件。是否

使用smtpd的任何例子?我不是专家,所以我需要一些例子

来学习如何使用它。
Hi,

I just want to send a very simple email from within python.

I think the standard module of smtpd in python can do this, but I
haven''t found documents about how to use it after googleing. Are there
any examples of using smtpd ? I''m not an expert,so I need some examples
to learn how to use it.



参见标准文件:

http://docs.python.org/lib/SMTP-example.html


HTH,
Rob

See standard documentation:

http://docs.python.org/lib/SMTP-example.html

HTH,
Rob





10月15日晚上10点25分,fdu。夏... @ gmail.com" < fdu.xia ... @ gmail.com>

写道:


On Oct 15, 10:25 pm, "fdu.xia...@gmail.com" <fdu.xia...@gmail.com>
wrote:




我只想在python中发送一封非常简单的电子邮件。


我认为python中smtpd的标准模块可以做到这一点,但是我

谷歌后没有找到关于如何使用它的文件。是否

使用smtpd的任何例子?我不是专家,所以我需要一些例子

来学习如何使用它。
Hi,

I just want to send a very simple email from within python.

I think the standard module of smtpd in python can do this, but I
haven''t found documents about how to use it after googleing. Are there
any examples of using smtpd ? I''m not an expert,so I need some examples
to learn how to use it.



smtpd用于中继邮件而不是发送邮件。你需要什么dns

工具包(搜索cheeseshop)将域名映射到传入邮件列表

服务器,然后使用stdlib smtplib尝试将消息提交给

他们。

smtpd is for relaying mail not for sending. What you need it a dns
toolkit (search cheeseshop) to map domain name to list of incoming mail
servers, and then using stdlib smtplib try to submit the message to
them.


或者有更好的方法可以解决这个问题吗?
Or maybe there is a better way to to this?



如果您在严格的公司防火墙后面或者如果ISP

阻止端口25传出连接,这将无法工作。在这些情况下你_have_

使用外部邮件服务器。

This won''t work if you''re behind a strict corporate firewall or if ISP
is blocking port 25 outgoing connections. In those cases you _have_ to
use an external mail server.


Rob Wolfe写道:
Rob Wolfe wrote:
fd********@gmail.com 写道:
fd********@gmail.com wrote:

>

我只想在python中发送一封非常简单的电子邮件。

我认为标准模块python中的smtpd可以做到这一点,但是我没有找到关于如何在google之后使用它的文档。是否有使用smtpd的任何示例?我不是专家,所以我需要一些例子来学习如何使用它。
>Hi,

I just want to send a very simple email from within python.

I think the standard module of smtpd in python can do this, but I
haven''t found documents about how to use it after googleing. Are there
any examples of using smtpd ? I''m not an expert,so I need some examples
to learn how to use it.



参见标准文档:

http://docs.python.org/lib/SMTP- example.html


HTH,

Rob


See standard documentation:

http://docs.python.org/lib/SMTP-example.html

HTH,
Rob



我已经阅读了示例并复制了代码并保存为send.py,然后我运行它。
运行它。输出结果如下:

I have read the example and copied the code and save as send.py, then I
run it. Here is the output:


这篇关于如何在没有外部SMTP服务器的情况下发送电子邮件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆