remark42 icon indicating copy to clipboard operation
remark42 copied to clipboard

Office365 SMTP

Open Threnklyn opened this issue 2 years ago • 2 comments

Hi there,

I want to use Office365 to send mails https://support.microsoft.com/en-us/office/pop-imap-and-smtp-settings-8361e398-8af4-4e97-b147-6c6c4ac95353

but sadly I get the following error:

[WARN]  {notify/notify.go:168 notify.(*Service).do.func1} failed to send to email: with username '[email protected]' at server smtp.office365.com:587 with StartTLS, 1 error occurred:
Aug 26 07:40:29  remark[37761]:         * problem sending admin email notification to "[email protected]": failed to auth to smtp smtp.office365.com:587, 504 5.7.4 Unrecognized authentication type [FR0P281CA0125.DEUP281.PROD.OUTLOOK.COM]

my environment variables:

"[email protected]"
"SMTP_HOST=smtp.office365.com"
"SMTP_PORT=587"
"[email protected]"
"SMTP_PASSWORD=************"
"SMTP_STARTTLS=true"
"SMTP_TLS=false"

Threnklyn avatar Aug 26 '22 08:08 Threnklyn

looks like Microsoft does not allow Plain Auth anymore, which is used in go-pkgz/email/email.go. The go net/smtp package does not support the login mechanism LOGIN. Here is an example I found for login auth using net/smtp https://gist.github.com/homme/22b457eb054a07e7b2fb

Shall I post an issue in https://github.com/go-pkgz/email/issues too?

Threnklyn avatar Aug 26 '22 08:08 Threnklyn

Please post it there, and feel free to send the PR if you're interested in preparing one. Thank you!

paskal avatar Aug 26 '22 11:08 paskal