Guide
Connect over SMTP
Connect your site, CRM or server. Server, port 2525, STARTTLS, and the username and password for a verified domain.
Have a verified domain and its SMTP credentials ready. Your panel password and an API key cannot authenticate an SMTP connection.
Set up your account and domainReviewed on September 11, 2026
Connection details
Server and port are the same for everyone. The password is the one shown when you create each SMTP user.
- Server
-
smtp.mailshogun.com - Port
-
2525 - Security
- STARTTLS
- Authentication
- LOGIN / PLAIN
Use smtp.mailshogun.com:2525 with STARTTLS and authentication. Examples for other providers using 465 or 587 do not apply to this connection.
Dialogue with the server
Three steps: connect, sign in and get the 250 OK reply.
Session
220 smtp.mailshogun.com:2525 ESMTP
EHLO client.local
250-STARTTLS
STARTTLS
220 2.0.0 Ready to start TLS
TLS ready
Create SMTP username and password
Open a verified domain. Under Connection, create the SMTP user. Username and password are shown once: store them in your app.
Without a verified domain there is no SMTP user. Without a tier or a card, the panel will not let you create them.
Examples
Configuration snippets for an existing application. Install PHPMailer with Composer or Nodemailer with npm and import the library. Set MAILSHOGUN_SMTP_USER and MAILSHOGUN_SMTP_PASSWORD in the server environment. Also configure a sender on the verified domain.
use PHPMailer\PHPMailer\PHPMailer;
require 'vendor/autoload.php';
$mail = new PHPMailer(true);
$mail->isSMTP();
$mail->Host = 'smtp.mailshogun.com';
$mail->Port = 2525;
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
$mail->SMTPAuth = true;
$mail->Username = getenv('MAILSHOGUN_SMTP_USER');
$mail->Password = getenv('MAILSHOGUN_SMTP_PASSWORD');
WordPress includes PHPMailer. Add this hook to your own plugin; also configure the wp_mail() sender on your verified domain. Keep passwords out of themes and the repository.
add_action('phpmailer_init', function ($phpmailer) {
$phpmailer->isSMTP();
$phpmailer->Host = 'smtp.mailshogun.com';
$phpmailer->Port = 2525;
$phpmailer->SMTPSecure = 'tls'; // STARTTLS
$phpmailer->SMTPAuth = true;
$phpmailer->Username = getenv('MAILSHOGUN_SMTP_USER');
$phpmailer->Password = getenv('MAILSHOGUN_SMTP_PASSWORD');
});
import nodemailer from 'nodemailer';
const transporter = nodemailer.createTransport({
host: 'smtp.mailshogun.com',
port: 2525,
secure: false, // STARTTLS
requireTLS: true,
auth: { user: process.env.MAILSHOGUN_SMTP_USER, pass: process.env.MAILSHOGUN_SMTP_PASSWORD },
});
Common failures
-
Wrong port
Check that your application uses the specified host and port 2525. Also check that your hosting allows outbound connections to this port.
-
Missing STARTTLS
Port 2525 expects STARTTLS (secure: false and requireTLS in Nodemailer; ENCRYPTION_STARTTLS in PHPMailer).
-
Unverified domain
The SMTP user is tied to a verified domain. If DNS has not passed yet, create or verify the domain first.
-
No tier or card
Creating SMTP users and sending needs a contracted tier and a saved card.
Check the result
- Set a sender on the verified domain and a recipient you control. The examples in this guide configure a connection; they do not send by themselves.
- A 250 after message acceptance confirms queuing. Check Statistics and the recipient mailbox afterwards.
- For a timeout, check outbound TCP access to port 2525 with your provider. For AUTH errors, check SMTP credentials. For TLS errors, check the hostname and certificate; keep TLS certificate validation enabled.
Continue with
Still stuck? Share the error code, time and affected domain with support. Remove passwords, API keys and message contents. Support