python create mail

Peter Hansen peter at
Thu Jan 12 08:41:00 EST 2006

anyab5 at wrote:
> hey I need help in sending email,
> It seems that while using  this set of commands
> from smtplib import SMTP
>  s = SMTP()
>  s.set_debuglevel(1)
>  s.connect('')
> I should be able to get a connection but what I get is this error

Try connecting with telnet from the command line.

   telnet 25

You should see some sort of greeting from the server, probably starting 
with "220".

If that works, then the Python code should work.  If that does not work, 
then it's not a Python problem (firewall, host rejecting your address, 
no SMTP server on that host, etc).


More information about the Python-list mailing list