# SMTP unrecognized authentication type with Office 365

**URL:** <https://meta.discourse.org/t/smtp-unrecognized-authentication-type-with-office-365/145830>\
**Category:** Self-hosting\
**Tags:** email\
**Created:** [27 במרץ,‏ 2020,‏ 3:34pm UTC](https://meta.discourse.org/t/smtp-unrecognized-authentication-type-with-office-365/145830 "2020-03-27T15:34:14Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![thfisher](https://avatars.discourse-cdn.com/v4/letter/t/c67d28/32.png) [@thfisher](https://meta.discourse.org/u/thfisher)\
**Post date:** [25 ביולי,‏ 2020,‏ 1:16pm UTC](https://meta.discourse.org/t/smtp-unrecognized-authentication-type-with-office-365/145830/6 "2020-07-25T13:16:38Z")

</div>

I use [socketlabs.com](http://socketlabs.com) as my email delivery service, and had a similar issue. In my case the solution was to edit lib/tasks/emails.rake as follows:  
Change the line:  
`Net::SMTP.start(smtp[:address], smtp[:port], 'localhost', smtp[:user_name], smtp[:password])`  
to  
`Net::SMTP.start(smtp[:address], smtp[:port], 'localhost', smtp[:user_name], smtp[:password], smtp[:authentication])`

Without this change, the DISCOURSE\_SMTP\_AUTHENTICATION: login doesn’t get passed to the lower level SMTP code.

I haven’t tested this to see if the modified code still works for other authentication methods, but it fixes the problem for login authentication.

---

_[View the full topic](https://meta.discourse.org/t/smtp-unrecognized-authentication-type-with-office-365/145830)._
