We have deployed the production version of our Helpdesk application on Docker. During SMTP configuration with Office 365, we’re facing an issue.
Since MFA is enabled, we’re using an app password, but the system throws this error:
Please check your email login credentials. imaplib.IMAP4.error: b’LOGIN failed.’
The credentials are correct, but it keeps failing. Could you please help us verify if any specific settings like IMAP access or authentication method need to be enabled from the Office 365 side?
Your support would be appreciated.
1 Like
Use OAuth method and create a Conected app for Microsoft
Follow this steps: [Tutorial] Connecting Frappe/ERPNext to Microsoft 365 mail services OAuth
1. Verify App Password Configuration
- Generate a New App Password: Always ensure you’re using a freshly generated app password rather than the user’s regular password.
- Double-Check for Typos: Even a single character error in the app password can lead to authentication failure. Carefully review the input.
- Confirm the Correct Email Address: Make sure you are entering the correct email address associated with the user’s account.
2. Ensure SMTP Authentication (SMTP AUTH) Is Enabled
- Navigate to the Microsoft 365 Admin Center:
- Go to Users > Active Users.
- Select the relevant user and access their Mail settings.
- Under Email apps, select Manage email apps.
- Verify that Authenticated SMTP is checked (enabled).
Hi,
I am able to send email using a py or ps1 script. But the same account / password combination gives error in my setup.
Error: Please check your email login credentials. imaplib.IMAP4.error: b’LOGIN failed.’
Version: ERPNext: v15.74.0 (version-15)
Screenshot of my configuration.
It wasn’t working yesterday… I spent at least 2 hours…
Today without any afforts it started…
Hi @harshit:
Changes on Microsoft tenant config use to take a while …
Maybe it was the reason.

