python and sll/Exchange 2007: No suitable authentication method found

user63503 picture user63503 · Nov 6, 2009 · Viewed 8.4k times · Source

I'm trying to send emails from a python script with smtplib, and it works with no problems with smtp through Exchange 2003, but with Exchange 2007 shows:

SMTPException: No suitable authentication method found.

Python code is the same in both cases (except server and login information of course).

I'm passing username and password in a script in plain text, and looks like Exchange 2007 is not configured to work with AUTH_PLAIN = "PLAIN" (line 545 of smtplib.py), and I don't know where to disable ssl there.

Would appreciate any ideas.

Answer

JohnMudd picture JohnMudd · May 15, 2014

You might need to switch to STARTTLS authentication. Here's an example that helped me.

How To Send Email In Python Via SMTPLIB