@Murugan Andezuthu Dharmaratnam Thanks for reply!
SMTP authentication does not work well in an environment were MFA is enabled , this could be happening because of that.
You may refer to the article How to set up a multifunction device or application to send email using Microsoft 365 or Office 365 | Microsoft Docs to view the requirements and limitations of smtp.
Kindly try the following:
- In the Azure portal, on the left navigation bar, click Microsoft Entra ID
- On the Overview page, in feature highlights section, click Conditional Access.
- Go to Microsoft Azure , sign in with a global admin account
- On the Conditional Access page, check the policies and modify them.
Let us know