# SMTP with office365?

**URL:** https://meta.discourse.org/t/smtp-with-office365/77467
**Category:** Self-hosting
**Tags:** email
**Created:** [January 8, 2018, 11:57am UTC](https://meta.discourse.org/t/smtp-with-office365/77467 "2018-01-08T11:57:45Z")
**Posts on this page:** 1
**Showing post:** 13

<div class="post-metadata">

### Author: ![LeeNeighoff](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/leeneighoff/32/282406_2.png) [@LeeNeighoff](https://meta.discourse.org/u/LeeNeighoff)
#### Post date: [September 9, 2023, 5:01pm UTC](https://meta.discourse.org/t/smtp-with-office365/77467/13 "2023-09-09T17:01:28Z")

</div>

Disabling security defaults may no longer be necessary with MFA enforcement. If you enable and then enforce MFA on a M365 account, you can go to the account’s MFA setup page and add an app password to use and bypass MFA. I got it working with a M365 Business Basic-licensed user with MFA enforcement, SMTP AUTH, and security defaults all enabled. I just had to turn up the SMTP open and read timeouts with two additional lines. 30 may be excessive, but 5 was too little.

Working app.yml entry, as of September 2023:

```plaintext
  DISCOURSE_SMTP_ADDRESS: smtp.office365.com
  DISCOURSE_SMTP_PORT: 587
  DISCOURSE_SMTP_USER_NAME: user@domain.com
  DISCOURSE_SMTP_PASSWORD: whatever-your-app-password-is
  DISCOURSE_SMTP_AUTHENTICATION: login
  DISCOURSE_SMTP_ENABLE_START_TLS: true
  DISCOURSE_NOTIFICATION_EMAIL: user@domain.com
  DISCOURSE_SMTP_OPEN_TIMEOUT: 30
  DISCOURSE_SMTP_READ_TIMEOUT: 30

```

---

_[View the full topic](https://meta.discourse.org/t/smtp-with-office365/77467)._
