Self-hosted Bitwarden's 2FA Email Not Sending

My Self-hosted Bitwarden Instance appears to be unable to send emails. Since my account is fairly new, I need to verify my email to unlock a lot of features (this is what bitwarden says). However, each time I click the send email button I get the following error:
“An error has occurred. an unhandled server error has occurred.”
image

My config file looks like this:

globalSettings__mail__replyToEmail=no-reply@bitwarden.mycompany.com
globalSettings__mail__smtp__host=stmp.office365.com
globalSettings__mail__smtp__port=587
globalSettings__mail__smtp__ssl=false
globalSettings__mail__smtp__username=valid email
globalSettings__mail__smtp__password=valid password

I know this ‘valid’ email and password is working and is authorized to send emails on my domain, as I tested it on myself. What else must I do to give Bitwarden the permissions to send this email?

Thank you in advance for the help!

I doubt even a company like MS would not call a sub domain

http://stmp.office365.com/

I strongly assume

http://smtp.office365.com/

is to be used….

1 Like

Adding this was part of the problem. I can’t believe I did that :man_facepalming:. Emails are however still not working.

My configuration file is now:
globalSettings__mail__replyToEmail=no-reply@bitwarden.mycompany.com
globalSettings__mail__smtp__host=http://smtp.office365.com
globalSettings__mail__smtp__port=587
globalSettings__mail__smtp__ssl=false
globalSettings__mail__smtp__username= valid email
globalSettings__mail__smtp__password= valid password

I believe the point of @mr.vince’s comment was to point out the typo.

Regardless, as far as I know, Office 365 mail servers no longer accept SMTP connections with Basic Auth — OAuth 2.0 must be used by the email client (Bitwarden in this case).

I don‘t use MS stuff but I‘d further believe that the mail server domain should be entered without a leading „http://“…

Again, I think that @mr.vince brings up a valid point. In addition, the following advice from another thread may be relevant to you:

You’re correct, this fixed the problem. http:// and https:// indicate port 80 and 443 respectively; however, since I want to use smtp, I should be referencing smtp’s port 25 (for unencrypted) and 587 (for encrypted). Thank you all for your inputs

For the benefit of future readers of this thread (who may be trying to solve a similar problem), it may be helpful if you posted the final (working) version of your configuration file.

Tip: First click the text editor’s </> (preformatted text) button on an empty line of your response, and then paste your settings.