Generate ready-to-run SMTP test code for any provider. Fill in your settings and copy the code.
// Install: npm install nodemailer
const nodemailer = require('nodemailer');
const transporter = nodemailer.createTransport({
host: '',
port: 587,
secure: false, // true for 465, false for 587
auth: {
user: '',
pass: '',
},
});
async function sendTestEmail() {
try {
const info = await transporter.sendMail({
from: '',
to: '',
subject: 'SMTP Test Email',
text: `This is a test email sent to verify SMTP configuration.`,
});
console.log('Message sent:', info.messageId);
} catch (error) {
console.error('Error:', error);
}
}
sendTestEmail();| Port | Encryption | Usage |
|---|---|---|
25 | None (plaintext) | Server-to-server relay. Often blocked by ISPs. |
465 | Implicit SSL/TLS | Direct encrypted connection. Legacy but widely supported. |
587 | STARTTLS | Recommended submission port. Starts plain, upgrades to TLS. |
2525 | STARTTLS (alternate) | Alternative when 587 is blocked. |
| Provider | SMTP Host | Ports | Authentication |
|---|---|---|---|
| Gmail | smtp.gmail.com | 465, 587 | App Password (2FA required) |
| Outlook | smtp-mail.outlook.com | 587 | Account password or OAuth |
| Yahoo | smtp.mail.yahoo.com | 465 | App Password |
| SendGrid | smtp.sendgrid.net | 587, 465 | API Key as password |
| Amazon SES | email-smtp.<region>.amazonaws.com | 587, 465 | SMTP credentials |
| Mailgun | smtp.mailgun.org | 587, 465 | Domain credentials |
| Zoho | smtp.zoho.com | 465 | Account password |
SMTP Tester generates ready-to-run code that connects to any SMTP server and sends a test email, so you can confirm your outbound mail configuration works before wiring it into an application. You enter the host, port, encryption mode (STARTTLS on 587, implicit SSL/TLS on 465, or plain on 25), username, password, and the from/to addresses, and the tool builds a working snippet in the language and library you choose.
It is built for backend developers, DevOps engineers, and system administrators who need to verify credentials for providers like Gmail, Amazon SES, SendGrid, Mailgun, Postmark, or a self-hosted Postfix box. Because the code runs on your own machine or server, it reflects exactly what your production stack will do.
SMTP (Simple Mail Transfer Protocol) is a text-based conversation between your client and a mail server. The exchange follows a fixed sequence: the client sends EHLO to identify itself, negotiates encryption with STARTTLS when required, authenticates via AUTH LOGIN or AUTH PLAIN, then issues MAIL FROM, RCPT TO, and DATA to hand over the message. Each command gets a three-digit reply code, and codes in the 2xx range mean success while 4xx (temporary) and 5xx (permanent) signal problems.
The tool maps your inputs onto whichever library you select and sets the transport correctly for the port. Port 587 uses STARTTLS, which starts unencrypted and upgrades the connection; port 465 uses implicit TLS, encrypted from the first byte; port 25 is typically plain server-to-server relay. The most common failure is 535 5.7.8 authentication failed, which usually means a wrong password or a provider requiring an app password or OAuth2 instead of your login credentials.
Because the snippet is standard, dependency-free code for its ecosystem, you can drop it straight into a script to reproduce and debug delivery issues, or keep it as a health check for a mail queue.
No. It generates code that you run on your own machine or server. This means the SMTP connection and any credentials never leave your environment, and the test reflects exactly what your production network can reach.
Yes, it is completely free. The tool runs in your browser, so the host, credentials, and message you type are not sent to or stored on our servers. Nothing is logged.
Use port 587 with STARTTLS for most modern providers, port 465 with implicit SSL/TLS as an alternative, and port 25 only for unauthenticated server-to-server relay. If one port is blocked by your host or firewall, try the other secure port.
Gmail and Google Workspace no longer accept your normal account password over SMTP. Enable 2-step verification and generate an app-specific password, or use OAuth2, then use that value in the password field.
You can generate snippets for common stacks such as Python smtplib, Node.js Nodemailer, PHP PHPMailer, Ruby, Go, and a raw curl command, each configured for your chosen port and encryption mode.
Yes. Enter that provider's SMTP endpoint, port, and the SMTP username and password (or API-key-based credentials) they issue. The generated code works with any standards-compliant SMTP server.
A 250 accepted response only means the server took the message, not that it reached the inbox. Check the spam folder, verify your domain's SPF, DKIM, and DMARC records, and review the provider's suppression or bounce logs.