Symptom
- When attempting to connect to an SMTP server from SAP Datasphere tenant, the following error message appears:
"Could not connect to the SMTP server". - Additional messages observed: “Authentication exception while sending: **** Authentication unsuccessful”, “ERR_TEST_CONN_FAILED: Test connection failed. Please validate the parameters.”, and “500 Internal Server Error” during test connection."
Environment
- SAP Datasphere or SAP Analytics Cloud
Reproducing the Issue
- In Datasphere, navigate to System -> Administration -> tab Notifications and open the Custom SMTP configuration.
- Configure SMTP with OAuth (enter host/port, user, client details) and refresh or generate a new OAuth token.
- Select Check Configuration or Test Connection.
- The system returns “Could not connect to the SMTP server” and related authentication errors.
Cause
The OAuth token was generated for a different, currently SSO-signed Microsoft Entra account than the SMTP-configured user. Because the browser reused the active session, no account selection was prompted, leading to authentication failure (535 5.7.3).
Resolution
- In a new private/incognito browser window (or after signing out), open the Microsoft sign-in portal.
- Select the profile icon and choose Sign in with a different account.
- Sign in with the exact account that is configured as the SMTP user.
- Return to the application’s Custom SMTP configuration and regenerate the OAuth token. Ensure the prompt allows selecting the correct account; select the SMTP-configured user.
- Save the configuration and run Check Configuration/Test Connection again to confirm success.
- If issues persist, verify the OAuth endpoints match your identity provider guidance (for Microsoft Entra ID, the token endpoint format is typically .../oauth2/v2.0/token) and then regenerate the token once more.
See Also
- SAP Datasphere Help page Configure Notifications
- Refer to: Authorize API access with Microsoft Entra ID
- Refer to: Steps to configure Custom SMTP server
Keywords
smtp, could not connect to the smtp server, 535 5.7.3, authentication unsuccessful, oauth, refresh token, microsoft entra id, office 365 smtp, custom smtp, notifications, test connection failed, ERR_TEST_CONN_FAILED, 500 internal server error, token generation, sso session, sendEmail{[Custom SMTP]]:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Authentication exception while sending: 535 5.7.3 Authentication unsuccessful [xxxxxxxxxxxxx.xxxxxxxx.prod.outlook.com 2026-xx-xxTxx:xx:xx.xxx]\n , KBA , LOD-ANA-SCH , SAC Story Scheduling and Publication , DS-SEC-AUTZ , Authorizations (Locks, etc.) , LOD-ANA-ADM , SAC Administration , Problem
SAP Knowledge Base Article - Public