faqts : Computers : Programming : Languages : Python : Common Problems : Email

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

2 of 23 people (9%) answered Yes
Recently 0 of 10 people (0%) answered Yes

Entry

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 localhost.

May 27th, 2000 19:58
unknown unknown, Andrew Henshaw


I'm guessing that your code looks something like:

  import smtplib

  server=smtplib.SMTP('localhost')
  server.connect()


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.