On Tue, Jan 6, 2009 at 4:45 AM, Marco Petersen
<[email protected]> wrote:
> I'm using Python 2.5.4. I wanted to try out the SMTP module. I tried to send
> an email through my Gmail account but it keeps saying that the connection
> was refused.
>
> This is the code that I used :
>
> import smtplib
> msg = 'Test'
>
>
> server = smtplib.SMTP('smtp.gmail.com')

>From the docs here
http://mail.google.com/support/bin/answer.py?answer=77662
Google SMTP uses port 587, not the standard SMTP port 25. Try
  server = smtplib.SMTP('smtp.gmail.com', 587)

Kent
_______________________________________________
Tutor maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/tutor

Reply via email to