October 29, 2017

Sending Email via Office 365

Filed under: Scripting — Marcus Tettmar @ 6:23 pm

We’ve had a few questions lately about how to send email using the SMTPSendMail function via the Office 365 SMTP server.

Until Macro Scheduler 14.4.02 which we have released today this wasn’t possible as explicit TLS was required and SMTPSendMail did not support it. We have now added this. So as long as you have updated to Macro Scheduler 14.4.02 (and you have a valid Office 365 account) here’s the code you need to send an email via the Office 365 mail server:

Let>server=smtp.office365.com
Let>SMTP_AUTH=1
Let>SMTP_USERID=YOUR_OFFICE365_USERID
Let>SMTP_PASSWORD=YOUR_OFFICE365_PASSWORD
Let>SMTP_PORT=587
Let>SMTP_SSL=1
Let>SMTP_USETLS=3
SMTPSendMail>RECIPIENT_EMAIL,server,YOUR_OFFICE365_EMAIL,YOUR_NAME,SUBJECT HERE,BODY TEXT,

See also:
http://help.mjtnet.com/article/4-sending-retrieving-emails-via-gmail-ssl