Today I Learned: 14/01/2022 - SMTP settings for a custom domain Office 365 Exchange installation
Publish date: 14 Jan 2022
While developing an automated email system for the upcoming Lions MD410 Convention I needed the SMTP settings for the Lions District 410E Office 365 Exchange server at the lions410e.org.za domain. Some googling and trial and error led me to this page and these settings:
- SMTP Server: smtp.office365.com
- Port: 587
- Security Mode: STARTTLS
For the username and password, use the email address that will be sending the emails.
As an example, for the Python mailtools package:
from mailtools import SMTPMailer
mailer = SMTPMailer(
"smtp.office365.com",
port=587,
username="email_address@lions410e.org.za",
password="PASSWORD",
transport_args={"security": "STARTTLS"},
)
mailer.send_plain(
"email_address@lions410e.org.za",
["recipient1@recipient.com", "recipient2@recipient.com"],
"Hello!",
"Insightful email message goes here!"
)