Help! SMTPlib

Andrew Henshaw andrew.henshaw at
Sat May 27 02:21:47 EDT 2000

sjoshi at wrote:
> I'm trying to use the smtplib for sending mail, and I keep getting
>error: (10061, 'winsock error') when I try just to connect to the

I'm guessing that your code looks something like:

  import smtplib


If so, then your problem is that the server.connect() function was already
called when you instantiated "server".   The connection is automatically made
when you provide the hostname as a parameter to SMTP.

I believe that the SMTP example in the library documentation is in error, in
this regard.

Andrew Henshaw

More information about the Python-list mailing list