SMTPAuthenticationError

Larry Bates larry.bates at websafe.com
Tue May 29 13:19:20 EDT 2007


Ramashish Baranwal wrote:
> Hi,
> 
> I am trying to send a mail using smtplib. My server requires me to
> authenticate, for this I'm using SMTP.login function. However it
> fails-
> 
>>>> server = smtplib.SMTP(host='mail.domain', port=25)
>>>> server.login('username', 'password')
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
>   File "/usr/lib/python2.4/smtplib.py", line 587, in login
>     raise SMTPAuthenticationError(code, resp)
> smtplib.SMTPAuthenticationError: (535, 'authorization failed
> (#5.7.0)')
> 
> I am sure that I am giving the correct credentials. The same works in
> Thunderbird. Am I missing something here or am I supposed to use some
> other library for this?
> 
> Thanks in advance,
> Ram
> 
Are you sure that your SMTP server uses this type of authentication?
Some SMTP servers use POP3 followed by SMTP to authenticate instead.


use telnet to verify, this link might help.

http://www.computerperformance.co.uk/exchange2003/exchange2003_SMTP_Auth_Login.htm#3)%20Auth%20Login

-Larry



More information about the Python-list mailing list