How to send E-mail without an external SMTP server ?

Leo Kislov Leo.Kislov at gmail.com
Mon Oct 16 03:19:57 EDT 2006



On Oct 15, 10:25 pm, "fdu.xia... at gmail.com" <fdu.xia... at gmail.com>
wrote:
> 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 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?

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.




More information about the Python-list mailing list