I can send emails via a Gmail account using the Yagmail
module in Python but I am getting a SMTPAuthenticationError
when I try to do it with an Outlook email address.
Gmail required me to allow "less secure apps" to access my account but I can't find any such option for Outlook365.
This is my code for Gmail with Yagmail:
import keyring
keyring.set_password('yagmail', '[email protected]', 'mypassword')
import yagmail
FROM = "[email protected]"
TO = "[email protected]"
SUBJECT = "test email"
TEXT = "details go here"
yagmail.SMTP(FROM).send(TO, SUBJECT, TEXT)
I got it to work using the following:
The trick was to configure the SMTP TLS/SSL options.