Hello,
This issue stems from changes in Microsoft’s email security policies. Microsoft has been deprecating Basic Authentication for SMTP and other protocols in favor of Modern Authentication (OAuth 2.0) to enhance security. This is why the error message states:
"Authentication unsuccessful, basic authentication is disabled."
Since the email functionality was working fine earlier, it suggests your setup was using Basic Authentication, which is no longer supported for Microsoft 365 or Outlook email accounts.
Steps to Resolve the Issue
- Enable SMTP Authentication for the Mailbox
Although Basic Authentication is deprecated, SMTP AUTH can still be enabled for accounts if needed (temporarily). Follow these steps:
Log into Microsoft 365 Admin Center (admin credentials required):
- Navigate to Users > Active Users.
- Select the user account used for sending emails.
- Go to Mail > Manage email apps.
- Ensure Authenticated SMTP is enabled for the user account.
- In the Microsoft 365 Admin Center, go to Settings > Org settings.
- Select Modern Authentication.
- Enable Authenticated SMTP if it’s disabled globally.
- Select Modern Authentication.
- Go to Mail > Manage email apps.
- Select the user account used for sending emails.
Note: Microsoft may still phase out SMTP AUTH entirely for new accounts in the future.
- Use an App Password
If SMTP AUTH is enabled for the mailbox, you need to generate an App Password because Outlook and Microsoft 365 accounts no longer allow regular passwords for non-interactive logins (like SQL Server Database Mail).
- Steps to generate an App Password:
- Go to your Microsoft account security settings: https://mysignins.microsoft.com/security-info
- Enable Two-Step Verification if not already enabled.
- Under Security Info, select App Passwords and create a password.
- Use this app password in your SQL Server Database Mail configuration.
- Under Security Info, select App Passwords and create a password.
- Enable Two-Step Verification if not already enabled.
- Go to your Microsoft account security settings: https://mysignins.microsoft.com/security-info
- Modify SQL Server Database Mail Configuration
After enabling SMTP authentication and generating an App Password:
- Open SQL Server Management Studio (SSMS).
- Go to Management > Database Mail.
- Right-click and select Configure Database Mail.
- Update the SMTP account details:
- SMTP Server:
smtp.office365.com
- Port:
587
(TLS encryption) or25
.- SMTP Authentication: Use the App Password instead of your regular password.
- Enable Secure Connection: Yes (TLS).
- Test the configuration by sending a test email.
- SMTP Authentication: Use the App Password instead of your regular password.
- Port:
- SMTP Server:
- Switch to OAuth 2.0 (Modern Authentication)
If the above workaround does not work or SMTP AUTH is entirely disabled:
- SQL Server Database Mail does not natively support OAuth 2.0. You would need to:
- Use a middle layer application (e.g., a custom script or a mail relay server) that handles OAuth 2.0 token generation and sends emails through Microsoft’s API.
- Alternatively, consider using Microsoft Graph API for sending emails, which supports Modern Authentication.
Please let me know if any questions
Kindly accept answer if it helps
Thanks
Naveen