Office 365 mail

I am bit unsure about how the mail functions work in ERPNext.
we have supplied email accounts for all but “jobs” and “replies” for right now. We are able to receive email but can not reply to tickets/issues. we have configured other sites to use Office365 so pretty sure we have that setup right. however we are getting this error:

(535, '5.7.3 Authentication unsuccessful')
Traceback (most recent call last):
  File "/home/frappe/frappe-bench/apps/frappe/frappe/email/", line 306, in send_one
    smtpserver.sess.sendmail(email.sender, email.recipient, encode(email.message))
  File "/home/frappe/frappe-bench/apps/frappe/frappe/email/", line 174, in sess
    (self.password or "").encode('utf-8'))
  File "/usr/lib64/python2.7/", line 621, in login
    raise SMTPAuthenticationError(code, resp)
ValidationError: (535, '5.7.3 Authentication unsuccessful')

Since there is no mention of user it is hard to figure out what’s going on. Ideally if an issue is raised we want it to always go out as no matter whom is responding as this is the way we currently do it in other software?

We tried this setting in case its doing some sort of send as based on logged on user but that didn’t fix it:

Always use Account’s Email ID as Sender
Uses the Email ID mentioned in this Account as the Sender for all emails sent using this Account.

Any thoughts on this i am getting the daily logs just fine for backup and others but replying is still broken as above and not enough information to troubleshoot?


In case you are trying to use Gmail services with Google Apps for work, Please try by checking “Login Id is different” in your email account. As well as, try setting the account sending a random mail from any doctype to check for the issue.

Also, make “less secure apps” settings is checked or “turned on” in your google account settings page.

Hope this helps…

Thank you the title is Office365 not gmail wish there was better mail logging so it was easier to trouble shoot really should be a part of the gui…


Was your problem solved? Sorry, didn’t focus on your title Office365 :wink:

no where is the active mail log so i can look at on centos?


What is the service that you have configured for Office365? Because, depending upon that your Email Account settings would change or need to be updated

office 365 it would be helpful if there was a detailed log of the hand shake to view?

Can we get this resolved there is no way i can promote this product to customers if it doesn’t work with office365 which the vast majority of my customers use???

This might be a long shot, but we use office 365 and I was having issues setting it up with a generic email until I tried creating an ERPNext user with that email. I made a new user with that email, gave it no roles or permissions, and then set it as the default email account for incoming and outgoing with no issues.

Not sure why it worked, but, well… It did.


The email functions need to be reworked so that outgoing can be under any account instead of just one fixed account. I believe this would fix many of the issues listed in the forums…

1 Like

i have worked with Microsoft azure and office365 teams to confirm the mail is working and not blocked. i have successfully sent mail from telnet on the ERPNext box so the problem is with ERPNext implementation of the mail client, can we get detailed documentation on how this all works and better logging so we can fix it this product it is virtually useless for us if it doesn’t work with office365. there are many posting here about this issue so it seems there is interest in this functioning properly…

1 Like

Just to enforce the call of @imllc.
Office 365 is a major player in the market of communication and needs to be taken serious.
We would also want to start using this functionality.

As much as i have been trying to avoid this because i truly believe ERPNext should handle this within the app i am considering installing postfix and using the connector i already have setup in office365 to relay from ERPNext machine unless someone here will tell me they have a workable solution. I know the postfix ad a relay agent works and presumably ERPNext should be able to handle sending to a localhost.

This is becoming more than frustrating how can you have an erp product that doesn’t have good documentation on email which is at the core of erp functionality.

I resorted to setting up postfix as a relay on the same machine. which i have not had to do with numerous other devices and app to send mail through Office365 almost all were relatively painless.

i have successfully relayed mail to and through Office365 both inside and outside as shown here:
Subject: Test mail
This is a test email
So why is it that the mail functions of ERPNext are?
1 so poorly documented i.e. no clear instructions on how to work with one of the largest install base in corporate
2 Very poorly implemented logging i.e. you can see something wrong but it doesn’t capture the important info to coorect

Why not just implement a built in mail client so that you send and receive as the user based on function i.e. support sends and receives as support, info as info, jobs as jobs…
Being limited to just one outgoing default sender is just foolish for a product that shines in so many other ways which at this point i can barely explore because the critical component of mail is so broken…
You will see from my numerous post on this matter i have certainly put in the time and effort but i like others have been bitten by this inadequacy…

If someone could help since i cant seem to get ERPNext to send mail and receive each time consistently please tell me both from postfix and retrieving from office365 what settings should be:

1 what are the only entries that need to be in /etc/postfix/ given that i have an exchange connector and it works just fine from local telnet session on ERPNext machine but not from ERPNext app.
2 how should each of the accounts in ERPNext be setup so that i can send and receive from each one.
Notifications Default Sending

Sales Inbox Opportunity

Jobs Inbox Job Applicant

Replies Default Inbox Communication

Support Inbox Issue

i have been working this for over month and it is just amazing that other haven’t articulated an solution to this problem considering the players are ERPNext and one of the largest hosting providers in the world Microsoft and its certainly not for a lack of me trying everything listed here and then some…i want to support this product and have an integration planed but with out working email it is useless to us…

Any help here from erpnet? i have confirmed its the application not the email provider useless without email?

Folks at ERPNext this thread was started 19 days ago it appears that the silence is showing that there is little interest in helping resolve this critical problem. with over estimates of over 80 million users of office365 as of 2015 i think you missing a great opportunity to increase usage. i like a lot of others are coming here from other products like odoo please consider working with us in the Microsoft community to fix this problem…

@imllc I have it working for myself and several customers. Here is a screen shot hope it helps…


Thanks for your input i have modified the setting to match yours even though they are not the prescribed mail settings suggested by MSFT and it still doesn’t work keep in mind i went through the trouble to create an exchange connector and postfix and that works just fine when i telnet on the local machine i really believe there is a problem with the ERPNext mail client because i get this when i use a validated password for sending and with no clear documentation this is all futile:
(535, ‘5.7.3 Authentication unsuccessful’)
Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/email/”, line 306, in send_one
smtpserver.sess.sendmail(email.sender, email.recipient, encode(email.message))
File “/home/frappe/frappe-bench/apps/frappe/frappe/email/”, line 182, in sess
(self.password or “”).encode(‘utf-8’))
File “/usr/lib64/python2.7/”, line 621, in login
raise SMTPAuthenticationError(code, resp)
ValidationError: (535, ‘5.7.3 Authentication unsuccessful’)