I am trying to connect with my company's email server using smtplib in python Below is my code snippet:
server = smtplib.SMTP('mail.mycompany.com',25)
server.ehlo()
server.starttls()
server.login('my_email@mycompany.com', 'my_password')
When I run my code I get the following error:
smtplib.SMTPException: STARTTLS extension not supported by server.
After searching this error on google i found that my company's smtp server does not support starttls authentication so i have to remove server.starttls() this line from my code but when i remove this line I get following error:
smtplib.SMTPException: SMTP AUTH extension not supported by server.
I have spent whole day to search these errors but didn't find any solution.