I am a python newbie trying to email using Python 3.7. I am referring to the following python web page to put together my code. https://docs.python.org/3.7/library/email.examples.html I am not able to understand what is wrong. Do I have to update any settings in Outlook for the email to go through? Weird that the above documentation doesn't mention anything about my email password
#!/usr/bin/env python3
import smtplib
from email.message import EmailMessage
body = "Hello User,\nThis is to notify you that...."
msg = EmailMessage()
msg.set_content(body)
msg['Subject'] = 'Name Clash.....'
msg['From'] = 'pukav@outlook.com'
msg['To'] = 'iampukav@gmail.com'
s = smtplib.SMTP('smtp-mail.outlook.com', 587)
s.login('pukav@outlook.com', 'mypassword')
s.send_message(msg)
s.quit()
ERRORS:
in login "SMTP AUTH extension not supported by server."
smtplib.SMTPNotSupportedError: SMTP AUTH extension not supported by server.