# SMTP setting problem with Office365

**URL:** <https://meta.discourse.org/t/smtp-setting-problem-with-office365/61630>\
**Category:** Self-hosting\
**Created:** [26 Abril, 2017 10:20 UTC](https://meta.discourse.org/t/smtp-setting-problem-with-office365/61630 "2017-04-26T10:20:44Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![jianwei.lu](https://avatars.discourse-cdn.com/v4/letter/j/b9e5f3/32.png) [@jianwei.lu](https://meta.discourse.org/u/jianwei.lu)\
**Post date:** [26 Abril, 2017 10:20 UTC](https://meta.discourse.org/t/smtp-setting-problem-with-office365/61630/1 "2017-04-26T10:20:44Z")

</div>

I encounter a problem when I try to set the Email SMTP using Office365 online email server.

the SMTP setting of Office365 is:

```
Server name: smtp.partner.outlook.cn
Port: 587
Encryption method: STARTTLS

```

The discourse’s SMTP setting in the container/app.yml as below:

```
DISCOURSE_SMTP_ADDRESS: smtp.partner.outlook.cn
DISCOURSE_SMTP_PORT: 587
DISCOURSE_SMTP_USER_NAME: xxxx@xxxx.com
DISCOURSE_SMTP_PASSWORD: “xxxxxxxx"
DISCOURSE_SMTP_ENABLE_START_TLS: true       

```

The email can not be sent, and I found a error message in logs:

```
Sent mail to receiver@abc.com (5739.7ms)
Job exception: 504 5.7.4 Unrecognized authentication type [SHAPR01CA004.CHNPR01.prod.partner.outlook.cn]

```

and I also tried this way, still doesn’t work:

```
DISCOURSE_SMTP_ADDRESS: xxxx-com.mail.protection.partner.outlook.cn
DISCOURSE_SMTP_PORT: 25
DISCOURSE_SMTP_USER_NAME: xxxx@xxxx.com
DISCOURSE_SMTP_PASSWORD: “xxxxxxxx"
DISCOURSE_SMTP_ENABLE_START_TLS: false # (optional, default true)

```

Anyone can help me?

---

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