SMTP setting problem with Office365


(jianwei.lu) #1

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?


(Kai Liu) #2

In this line I noticed the first quotation mark is not the ASCII quotation mark of code 0x22, it is a Chinese one.


(jianwei.lu) #3

Oh, yes. It’s my mistake when I edit this post, but not happened in the real environment.
Thanks!


(Matt Palmer) #4

Presumably the set of authentication options which office365 supports doesn’t include any of the options that Discourse (or, rather, the SMTP library that Discourse uses) supports. What authentication modes does Office365 support?

Also, note that we don’t recommend using a mailbox provider such as Office365 or gmail for outgoing e-mail, as it is usually a violation of the provider’s terms of service, and often balks at sending the volume of mail that Discourse generates.