skip to Main Content

File "C:UsersSanketPatilAppDataLocalProgramsPythonPython38libsmtplib.py", line 655, in auth
raise SMTPAuthenticationError(code, resp)
smtplib.SMTPAuthenticationError: (535, b’5.7.139 Authentication unsuccessful, the request did not meet the criteria to be authenticated successfully. Contact your administrator. [PN2PR01CA0009.INDPRD01.PROD.OUTLOOK.COM]’)

Process finished with exit code 1

I have enabled SMTP auth too

2

Answers


  1. Issue is related to some security enablement’s or opening of ports related. You may try the below steps and try accessing. If it is working, then it can be confirmed related to default security and enable the required security features and re enable the security defaults.

    • Firstly login into to Azure portal
    • Click on Azure Active Directory
    • Then click onProperties.
    • Then Click on Manage security defaults.
    • Now make Enable security defaults =No.
    • Now click on Save button

    enter image description here

    Taken References from:

    Fix issues with printers, scanners, and LOB applications that send email using Microsoft 365 or Office 365 | Microsoft Docs

    Login or Signup to reply.
  2. Еhere may be two possible causes of this issue. These settings would block Legacy Authentication:

    These settings would block Legacy Authentication.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search