SAP Knowledge Base Article - Public

3765319 - SMTP connection cannot be established in SAP Datasphere or SAP Analytics Cloud

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

  1. In Datasphere, navigate to System -> Administration -> tab Notifications and open the Custom SMTP configuration.
  2. Configure SMTP with OAuth (enter host/port, user, client details) and refresh or generate a new OAuth token.
  3. Select Check Configuration or Test Connection.
  4. 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

  1. In a new private/incognito browser window (or after signing out), open the Microsoft sign-in portal.
  2. Select the profile icon and choose Sign in with a different account.
  3. Sign in with the exact account that is configured as the SMTP user.
  4. 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.
  5. Save the configuration and run Check Configuration/Test Connection again to confirm success.
  6. 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

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

Product

SAP Analytics Cloud all versions ; SAP Datasphere all versions