[Tutor] SMTP

Alan Gauld alan.gauld at btinternet.com
Thu Feb 11 23:09:35 CET 2010

"Grigor Kolev" <grigor.kolev at gmail.com> wrote

> I try send a mail with smtplib
> Server work with postfix.
> I try it
> ------------------------------------------------ 
> import smtplib
> s=smtplib.SMTP("localhost")

This requires you to have an SMTP server running on localhost.
Do you? I notice you say the server works with postfix but is it 
running when you exercise the script? Its one possibility.

> tolist=['grigor.kolev at gmail.com']
> msg = '''\
> From: grigor.kolev at gmail.com
> Subject: testin'
> This is a test '''
> s.sendmail("test at local", tolist, msg)
> -------------------------------------------------
> How can i send the file?
> And I am not sure that work.
> Mail is not sending but  perhaps problem i in my postfix.


Alan G

More information about the Tutor mailing list