ModulesEmail

Microsoft OutlookConnect Outlook and Microsoft 365 mailboxes over SMTP and IMAP

How to connect an Outlook or Microsoft 365 mailbox to OpenSequence: the servers and ports, Authenticated SMTP, app passwords with MFA, and what Microsoft blocks.

Edit on GitHub

This page connects a Microsoft mailbox as a sender's email channel. Read the limits below first: most Microsoft 365 mailboxes cannot connect today.

What it gives you

The rep's emails leave from their own Microsoft address, and replies come back over IMAP. See Email for limits and send windows.

OpenSequence signs in to SMTP and IMAP with a password. Exchange Online (Microsoft 365) turned off password sign-in for IMAP in 2022, and app passwords count as password sign-in. Outlook.com accounts need Microsoft's OAuth sign-in too. OpenSequence has no Microsoft OAuth sign-in yet, so these mailboxes are not supported: saving one fails with IMAP_AUTH_FAILED. The steps below work only for a Microsoft mailbox that still accepts a password on both SMTP and IMAP, such as an on-premises Exchange server.

What you need

  • Authenticated SMTP turned on for the mailbox. In Microsoft 365 an admin turns it on in the admin center under the user's Mail settings, "Manage email apps".
  • IMAP turned on for the mailbox, in the same place.
  • With MFA on, an app password instead of the normal password, where the organization allows app passwords.
  • An OpenSequence admin key and the sender id.

Steps

HostPortsecure
SMTPsmtp.office365.com587false (STARTTLS)
IMAPoutlook.office365.com993true

For an on-premises Exchange server, use its own host names. The user is the full address.

curl
curl -X PUT $SEQ/v1/senders/u_42/channels/email -H "Authorization: Bearer $ADMIN_KEY" -H "Content-Type: application/json" -d '{
  "provider": "smtp",
  "smtp": { "host": "smtp.office365.com", "port": 587, "secure": false, "user": "max@acme.com", "password": "app-password" },
  "imap": { "host": "outlook.office365.com", "port": 993, "secure": true, "user": "max@acme.com", "password": "app-password" }
}'

Check it works

GET /v1/senders/u_42/readiness returns "email": { "ok": true }. Send yourself a test sequence and reply: the enrollment exits with replied within about a minute.

Common errors

ErrorFix
422 IMAP_AUTH_FAILED on Microsoft 365 or Outlook.comMicrosoft refuses password sign-in for IMAP. This mailbox cannot connect until OpenSequence supports Microsoft OAuth.
422 SMTP_AUTH_FAILED with "SmtpClientAuthentication is disabled"Authenticated SMTP is off. An admin turns it on for the mailbox.
422 SMTP_AUTH_FAILED with MFA onUse an app password, not the normal password.
422 SMTP_REFUSEDsecure must be false on port 587, so the connection upgrades with STARTTLS.

On this page