Error Reference

SMTP connection failed: cannot connect to mail server

SMTP connection failed: cannot connect to mail server

Where this appears

This error appears in the System Log under System Diagnostics > Log > Application Log when ServiceNow attempts to send email notifications. It typically occurs during outbound email processing and can be seen in notification log entries or when testing email configurations.

Sourdough
Chrome Extension

Debugging this in a real instance?

Sourdough lets you trace "SMTP connection failed: cannot connect to mail server" through system logs, script errors, and API health in the ServiceNow tab you are already using.

Add to Chrome

Free to install. Pro $5/month after a 14-day no-card trial.
Pro requires the ServiceNow admin role. Upgrade inside the extension.

Overview
Tasks
CMDB
API
Metrics
Monitor
Internals
Instance:sourdoughdev·Version:Yokohama
Instance StateONLINE
System StatusFully Operational
Session Timeout90 minutes
Logged-In Sessions2 (20 active)
Build Nameyokohama-12-18-2024_p1
IP Address10.159.128.43
Instance HealthHealth Score: 90%
🔥 5dSourdough (Chrome Plugin)Dark Mode

Cause

Incorrect SMTP server hostname or IP address configured in the email properties. The server name may be misspelled or the IP address may be outdated. (high likelihood)

Wrong SMTP port number specified in the configuration. Common ports are 25, 465, or 587, and using the incorrect port will prevent connection. (high likelihood)

Firewall or network security blocking outbound connections on the SMTP port. Corporate firewalls often block port 25 or require specific whitelist entries. (medium likelihood)

TLS/SSL encryption settings mismatch between ServiceNow and the mail server. The server may require encryption while ServiceNow is configured for plain text or vice versa. (medium likelihood)

Mail server is temporarily unavailable or experiencing downtime. The SMTP service may be stopped or the server may be undergoing maintenance. (low likelihood)

Fix

Step 1: Navigate to System Properties > Email and verify the SMTP server hostname or IP address in the glide.smtp.server property matches your organization's mail server configuration.

Step 2: Check the SMTP port setting in glide.smtp.port property and confirm it matches your mail server requirements (typically 25, 465 for SSL, or 587 for STARTTLS).

Step 3: Test connectivity from the ServiceNow instance by going to System Diagnostics > Connectivity Tests and create a new test to your SMTP server on the configured port.

Step 4: Review the TLS/SSL settings by checking glide.smtp.ssl_enable and glide.smtp.starttls_enable properties to ensure they match your mail server's encryption requirements.

Step 5: Verify network connectivity by contacting your network administrator to confirm that outbound traffic on your SMTP port is allowed from the ServiceNow instance IP addresses.

Step 6: Test the email configuration by navigating to System Notification > Email > Test Email Configuration and sending a test message to validate the complete email flow.

Step 7: Check the System Log at System Diagnostics > Log > Application Log for any additional error details that might indicate authentication failures or protocol-specific issues.

Step 8: If using an external SMTP service like Office 365 or Gmail, verify that the service is operational and check for any service-specific authentication requirements or IP whitelist needs.

Test Your Knowledge

Quick 3-question quiz. See how your ServiceNow skills stack up.

Question 1 of 3Performance

A list view on a table with millions of records is slow. Best fix?

Select an answer to continue