Try ERPNext Try Frappe Cloud Buy Support Partners Foundation

Office 365 settings

Hi,

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: admin.microsoft.com -> 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:
YOURCOMAPNYNAME01i.mail.protection.outlook.com

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: https://docs.microsoft.com/de-de/azure/active-directory/fundamentals/concept-fundamentals-security-defaults#policies-enforced

Create a non-admin Email account.

Goto https://aad.portal.azure.com/ >> Users >> Multi-Factor-Authentication
Click on your user and deactivate MFA in the quicksteps.

ERPnext >> Settings >> Email Domain
Email Server: outlook.office365.com
Use IMAP: true
Use SSL: true
Port: 993

SMTP Server: YOURCOMAPNYNAME01i.mail.protection.outlook.com
Use TLS: true
Use SSL: false
Port: 25

ERPnext >> Settings >> Email Account
Email Address: foo@bar.com
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.
https://account.activedirectory.windowsazure.com/AppPasswords.aspx

Cheers
Jan

8 Likes

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 no-reply@domain.com for this. Can we set up? Need help @JanMrlth
Stuck after this process:
Add the IP of your ERP-next Server

Hi,
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?