# 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:** 2

<div class="post-metadata">

**Author:** ![evantill](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/evantill/32/116219_2.png) [@evantill](https://meta.discourse.org/u/evantill)\
**Post date:** [29 במרץ,‏ 2020,‏ 11:50am UTC](https://meta.discourse.org/t/smtp-unrecognized-authentication-type-with-office-365/145830/2 "2020-03-29T11:50:40Z")

</div>

try your configuration using openssl tool first

1. Encode your office365 user

```shell
echo -n "your email here " | openssl enc -base64
xxx_encoded_email_xxx

```

2.Encode your password

```shell
echo -n "your password here" | openssl enc -base64
xxx_encoded_password_xxx

```

3.Open a connection

```shell
openssl s_client -connect SMTP.office365.com:587 -starttls smtp -quiet -crlf

```

4.Test authentification

- wait for the message `250 SMTPUTF8`
- send `EHLO SMTP.office365.com`
- wait for response

```plaintext
250-PR3P189CA0029.outlook.office365.com Hello [88.138.0.68]
250-SIZE 157286400
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-AUTH LOGIN XOAUTH2
250-8BITMIME
250-BINARYMIME
250-CHUNKING
250 SMTPUTF8

```

- send `AUTH LOGIN`
- wait for `334 VXNlcm5hbWU6`
- send your encoded user login `xxx_encoded_email_xxx`
- wait for `334 UGFzc3dvcmQ6`
- send your encoded password `xxx_encoded_password_xxx`
- wait for response `235 2.7.0 Authentication successful`

---

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