I have been fighting with integrating outgoing emails to office365.
There are a few threads which discuss email issues.
For info:
By default Office365 will give a 554 error if the sender is not the same as the login (and discourse’s logs are not great).
The sender addr can be set as discussed elsewhere using
rails r “SiteSetting.notification_email = ‘discourse@yoursite.com’”
But I think this only sets the initial email sent.
Note, my forum URL is NOT related to my email domain…
For me, I had to set the following in (gui) settings:
1/ notification email
2/ site contact username - this means you MUST have a user who has the email you wish to send from (i.e. the email you login to smtp with).
Basically, ALL emails sent from discourse MUST have from set to the same email as the SMTP login to use a ‘normal’ office365 smtp connection. I hope the above achieves this, but it would be a ‘nice to have’ to be able to hard-set the email from field for every email, guaranteed.
s