eugene-eeo / mailthon

elegant email sending for Python
http://mailthon.readthedocs.org/en/latest/
MIT License
197 stars 19 forks source link

smtplib.SMTPNotSupportedError: SMTP AUTH extension not supported by server. #33

Closed debugtalk closed 7 years ago

debugtalk commented 7 years ago

When I use mailthon on Ubuntu, SMTPNotSupportedError exception occurred, while it's OK on my own Mac system.

Traceback (most recent call last):
  File "main.py", line 195, in <module>
    main()
  File "main.py", line 102, in main
    args.func(args)
  File "main.py", line 150, in main_crawler
    build_number
  File "/var/lib/jenkins/TestDevHub/WebCrawler/utils/mail.py", line 69, in send_mails
    content="<html><p>{}</p></html>".format(mail_content),
  File "/var/lib/jenkins/.virtualenvs/StoreCrawler/lib/python3.6/site-packages/mailthon/postman.py", line 90, in send
    with self.connection() as conn:
  File "/usr/local/lib/python3.6/contextlib.py", line 82, in __enter__
    return next(self.gen)
  File "/var/lib/jenkins/.virtualenvs/StoreCrawler/lib/python3.6/site-packages/mailthon/postman.py", line 67, in connection
    item(conn)
  File "/var/lib/jenkins/.virtualenvs/StoreCrawler/lib/python3.6/site-packages/mailthon/middleware.py", line 61, in __call__
    self.password)
  File "/usr/local/lib/python3.6/smtplib.py", line 696, in login
    "SMTP AUTH extension not supported by server.")
smtplib.SMTPNotSupportedError: SMTP AUTH extension not supported by server.

The linux system version is:

Linux version 3.13.0-79-generic (buildd@lcy01-24) (gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1) )

And I tried Python 3.4 and Python 3.6, both has the same exception.

eugene-eeo commented 7 years ago

Hi, firstly sorry for the late response. Seems like the AUTH command is not supported by the server. Are you trying to connect to something public like GMail? Or is it a server of your own? in the second case make sure that you have enabled authentication on your server and that it supports the AUTH extension.

Can I see your code that caused the problem?

debugtalk commented 7 years ago

The server is owned by our company, the strange point is that the exception only occurred on the specified server, even if I used the standard python smtp library instead. So I think that was the server's problem, and I should close this issue.

Thanks for your reply.