How to Test SMTP Server: Complete Guide
Learn how to test SMTP servers effectively with our comprehensive guide. Whether you're testing Gmail, Office 365, or custom SMTP servers, this tutorial covers everything you need to know.
Enter Server Info
Input SMTP host, port, and authentication credentials
Run the Test
Click test button to initiate SMTP connection check
Analyze Results
Review diagnostic output and fix any identified issues
Using an online SMTP test tool is the most convenient method to test SMTP servers. It requires no installation and provides instant results with detailed diagnostics.
Step-by-Step: How to Test SMTP Online
1Access the SMTP Test Tool
Navigate to an online SMTP tester like smtp-test.com. No registration or installation required.
2Enter SMTP Server Details
- •Server/Host: Your SMTP server address (e.g., smtp.gmail.com)
- •Port: Choose 587 (STARTTLS), 465 (SSL/TLS), or 25 (unencrypted)
- •Username: Your SMTP authentication username
- •Password: Your SMTP password or app-specific password
- •Security: Select Auto, SSL/TLS, STARTTLS, or None
3Run the SMTP Test
Click the "Test Connection" or "Test SMTP" button. The tool will connect to your SMTP server, authenticate, and display real-time results in a terminal-style output.
4Review Test Results
Analyze the output for:
- Successful connection to the SMTP server
- Valid authentication credentials
- SSL/TLS encryption working properly
- Server ready to send emails
Command line tools provide direct access to SMTP servers for testing. This method is useful for automation and detailed troubleshooting.
Using Telnet to Test SMTP
# Connect to SMTP server
telnet smtp.gmail.com 587
# Server responds with greeting
220 smtp.gmail.com ESMTP
# Send EHLO command
EHLO localhost
# Server lists capabilities
250-smtp.gmail.com
250-STARTTLS
250-AUTH PLAIN LOGIN
# Start TLS encryption
STARTTLS
# Authenticate (credentials in base64)
AUTH LOGIN
334 VXNlcm5hbWU6
[base64_username]
334 UGFzc3dvcmQ6
[base64_password]
235 Authentication successfulUsing OpenSSL for SSL/TLS Testing
# Test SMTP with STARTTLS (port 587)
openssl s_client -starttls smtp -connect smtp.gmail.com:587
# Test SMTP with SSL/TLS (port 465)
openssl s_client -connect smtp.gmail.com:465Using cURL to Test SMTP
# Test SMTP with cURL
curl -v --ssl-reqd \
--url 'smtp://smtp.gmail.com:587' \
--user 'your-email@gmail.com:your-password' \
--mail-from 'your-email@gmail.com' \
--mail-rcpt 'recipient@example.com' \
--upload-file email.txtPython SMTP Test Example
import smtplib
from email.mime.text import MIMEText
def test_smtp():
# SMTP server configuration
smtp_server = "smtp.gmail.com"
smtp_port = 587
username = "your-email@gmail.com"
password = "your-app-password"
try:
# Create SMTP connection
server = smtplib.SMTP(smtp_server, smtp_port)
server.set_debuglevel(1) # Enable debug output
# Start TLS encryption
server.starttls()
# Authenticate
server.login(username, password)
# Send test email
msg = MIMEText("SMTP test successful!")
msg['Subject'] = "SMTP Test"
msg['From'] = username
msg['To'] = "recipient@example.com"
server.send_message(msg)
server.quit()
print("✓ SMTP test successful!")
return True
except Exception as e:
print(f"✗ SMTP test failed: {str(e)}")
return False
test_smtp()Node.js SMTP Test Example
const nodemailer = require('nodemailer');
async function testSMTP() {
// Create transporter
const transporter = nodemailer.createTransport({
host: 'smtp.gmail.com',
port: 587,
secure: false, // Use STARTTLS
auth: {
user: 'your-email@gmail.com',
pass: 'your-app-password'
}
});
try {
// Verify connection
await transporter.verify();
console.log('✓ SMTP server is ready');
// Send test email
const info = await transporter.sendMail({
from: 'your-email@gmail.com',
to: 'recipient@example.com',
subject: 'SMTP Test',
text: 'SMTP test successful!'
});
console.log('✓ Email sent:', info.messageId);
return true;
} catch (error) {
console.error('✗ SMTP test failed:', error);
return false;
}
}
testSMTP();How to Test Gmail SMTP
Server Settings:
- Host:
smtp.gmail.com - Port:
587(STARTTLS) - Port:
465(SSL/TLS)
Authentication:
- Username: Your full Gmail address
- Password: App-specific password
- Enable 2FA and create App Password
How to Test Office 365 SMTP
Server Settings:
- Host:
smtp.office365.com - Port:
587(STARTTLS)
Authentication:
- Username: Your full Office 365 email
- Password: Your account password
- Modern Auth may be required
How to Test Amazon SES SMTP
Server Settings:
- Host:
email-smtp.[region].amazonaws.com - Port:
587or465
Authentication:
- Username: SMTP credentials username
- Password: SMTP credentials password
- Get from AWS Console
Connection Timeout - How to fix?
Causes: Firewall blocking port, incorrect server address, server down
Solutions:
- Verify SMTP server address and port number
- Check firewall rules allow outbound connections on SMTP ports
- Test from a different network to rule out ISP blocking
- Confirm the mail server is operational
Authentication Failed - How to fix?
Causes: Wrong credentials, app password required, authentication method not supported
Solutions:
- Double-check username and password
- Use app-specific password if 2FA is enabled
- Verify username format (some servers require full email, others just the local part)
- Check if the authentication method is supported by the server
SSL/TLS Certificate Errors - How to fix?
Causes: Expired certificate, self-signed certificate, hostname mismatch
Solutions:
- Verify the certificate is valid and not expired
- Ensure the hostname matches the certificate
- For testing only, you may need to disable certificate verification
- Update SSL/TLS certificates on the server
Relay Access Denied - How to fix?
Causes: Server requires authentication, IP not whitelisted, relay not configured
Solutions:
- Enable SMTP authentication
- Add your IP address to the server's whitelist
- Configure relay permissions on the mail server
- Use authenticated SMTP instead of anonymous relay
- Always test in a non-production environment first to avoid affecting live email delivery
- Use test email addresses to receive test messages and verify end-to-end delivery
- Test with SSL/TLS enabled to ensure secure email transmission
- Document your SMTP settings for future reference and troubleshooting
- Monitor SMTP logs regularly to catch issues before they affect users
- Keep credentials secure and use app-specific passwords when possible
Ready to Test Your SMTP Server?
Use our free online SMTP test tool to quickly verify your email server configuration. No installation required - just enter your details and test instantly.
Test SMTP Server Now