Try ERPNext Try Frappe Cloud Buy Support Partners Foundation

Office 365 settings


after one day of trying, I have a solution now, that I want to document here:

I use Office 365 as an Email provider in my company. In this tutorial I explain how to set it up. I assume, that you are the owner & admin of the office 365 company account.

Email Server
goto: -> Exchange
goto ‘Mail Flow’ -> Connectors

Add a Connector
From: E-Mail Server of your company
To: Office 365
Add the IP of your ERP-next Server

While setting up you Domain, you will create a MX-record that looks something like:

Preparing the Email Account
Your Email Account can not be a admin in your organisation! If that is the case you have to deactivate the azure security defaults:

Create a non-admin Email account.

Goto >> Users >> Multi-Factor-Authentication
Click on your user and deactivate MFA in the quicksteps.

ERPnext >> Settings >> Email Domain
Email Server:
Use IMAP: true
Use SSL: true
Port: 993

SMTP Server:
Use TLS: true
Use SSL: false
Port: 25

ERPnext >> Settings >> Email Account
Email Address:
Password: YourPassword


Disable SMTP server authentication: true

Let me know if that worked for you. I spend one day figuring out what to set up - hopfully this post helps you to do it quicker.

I am well aware, that you can use MFA and create an APP-Password. Feel free to contribute a tutorial if you need that.
You can set up App passwords here, after you have activated MFA.



Thanks for this guide. It works partially for me. All outgoing email is marked as Spam as it fails the SPF checks.

Now I need to configure the SPF domain settings to add the ERPNext hosted servers as permitted senders for my domain. I’ve asked ERPNext on a support ticket for these details.

I have created a for this. Can we set up? Need help @JanMrlth
Stuck after this process:
Add the IP of your ERP-next Server

how to add an email account if we are using Gmail as a mailing service.
Because, when I am creating an email account, it shows an error.

Server Error

Close Report

TypeError: Object of type ‘error’ is not JSON serializable

How to resolve this error?