smtplib and passwd's

Rajarshi Guha rajarshi at presidency.com
Thu Jul 18 15:50:02 EDT 2002


On Thu, 18 Jul 2002 11:34:25 -0400, Gerhard Häring wrote:

> * Rajarshi Guha <rajarshi at presidency.com> [2002-07-18 11:04 -0400]:
>> Hi,
>> I'm using smtplib to let my script send some mail through my smtp
>> server. However I need a logon and passwd for my smtp server - how does
>> smtplib handle such servers? Where can I specify my username and
>> password?
> 
> import smtplib
> 
> srv = smtplib.SMTP("mail.myprovider.com") srv.debuglevel = 25
> srv.login("myname", "mypassword")
> # ...
> 
> You need at least Python 2.2 for this login method to be available. OTOH
> backporting SMTP AUTH to earlier Python versions would certainly be
> possible. If there are problems, report back to me and I can send you an
> improved version (bugfixes, support for old auth advertising, and
> additional LOGIN auth method) that will (most likely) end up in Python
> 2.3.
>
Thanks, I moved upto 2.2 :)



More information about the Python-list mailing list