question about smtplib

nephish at xit.net nephish at xit.net
Mon Oct 3 15:09:27 EDT 2005


Hey there,

i am using the smtplib module in python 2.3

my question is, this works:

server = smtplib.SMTP(localhost)

then server.sendmail(to address, from address, message)


what i want to know is, how does the connection work?

when i do server.sendmail, does it connect then ? or did it connect
when
i made the object ?

the reason i need to know is i need to send several emails out at once
and would be best to only connect once, i think.

i know that i can call server.close(), i just dont know when it was
opened.
thanks




More information about the Python-list mailing list