← Back to docs

Send Email via SMTP

Send through EuroMail from WordPress, any framework, or any device that speaks SMTP -- authenticate with an API key.

Overview

EuroMail exposes an authenticated SMTP submission relay, so anything that can speak SMTP can send through EuroMail by changing four settings -- host, port, username, and password. No code changes, no SDK. It is the drop-in path for WordPress, legacy applications, framework mailers, printers, monitoring systems, and cron scripts.

Mail submitted over SMTP runs through the exact same pipeline as the REST API (POST /v1/emails): automatic DKIM signing, SPF/DMARC alignment, open and click tracking, suppression-list checks, and direct MX delivery from EuroMail's dedicated IPs. Whether you call the API or relay over SMTP, deliverability is identical.

Connection settings

SettingValue
Hostsmtp.euromail.dev
Port587 (STARTTLS) or 465 (implicit TLS / SSL)
EncryptionSTARTTLS on 587, TLS on 465 -- required either way
Usernameapikey (the literal string)
Passwordyour EuroMail API key (em_live_...)
AuthenticationRequired -- AUTH PLAIN / AUTH LOGIN, only after TLS

The username is always the literal word apikey. The password is the API key itself. This mirrors the convention used by Postmark, SendGrid, and SES, so most "SMTP provider" presets work unchanged.

Before you start

  1. Create an API key with the emails:send scope -- see API Keys & Authentication. Treat it like a password.
  2. Verify your sending domain -- see Domain Verification. Your From address must use a domain you have verified (e.g. [email protected]). Submissions from an unverified domain are rejected; this is what prevents the relay from being an open relay.

WordPress

WordPress sends its email (password resets, WooCommerce receipts, form notifications) through the host's mail() function by default, which lands in spam or vanishes entirely. Point it at EuroMail with any SMTP plugin.

WP Mail SMTP

  1. Install and activate WP Mail SMTP (Plugins → Add New).

  2. Go to WP Mail SMTP → Settings.

  3. Under Mailer, choose Other SMTP.

  4. Fill in the SMTP fields:

    FieldValue
    SMTP Hostsmtp.euromail.dev
    EncryptionTLS (this is STARTTLS, port 587) or SSL (port 465)
    SMTP Port587 for TLS, 465 for SSL
    AuthenticationOn
    SMTP Usernameapikey
    SMTP Passwordyour API key (em_live_...)
  5. Set From Email to an address on your verified domain (e.g. [email protected]) and a From Name.

  6. Save, then use Email Test to send a test message.

WP Mail SMTP labels STARTTLS as "TLS" and implicit TLS as "SSL". Use TLS + 587 unless you have a specific reason to prefer 465.

FluentSMTP and Post SMTP

Both work the same way -- pick the Other / Custom SMTP provider and enter the connection settings above (host smtp.euromail.dev, port 587/465, username apikey, password = API key). Store the API key in wp-config.php rather than the database when the plugin supports it:

define( 'EUROMAIL_API_KEY', 'em_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' );

Frameworks and languages

PHP (PHPMailer)

$mail = new PHPMailer\PHPMailer\PHPMailer(true);
$mail->isSMTP();
$mail->Host       = 'smtp.euromail.dev';
$mail->SMTPAuth   = true;
$mail->Username   = 'apikey';
$mail->Password   = getenv('EUROMAIL_API_KEY');
$mail->SMTPSecure = PHPMailer\PHPMailer\PHPMailer::ENCRYPTION_STARTTLS;
$mail->Port       = 587;

$mail->setFrom('[email protected]', 'Your App');
$mail->addAddress('[email protected]');
$mail->Subject = 'Hello from EuroMail';
$mail->Body    = 'Sent over SMTP.';
$mail->send();

Python (smtplib)

import os, smtplib, ssl
from email.message import EmailMessage

msg = EmailMessage()
msg["From"] = "[email protected]"
msg["To"] = "[email protected]"
msg["Subject"] = "Hello from EuroMail"
msg.set_content("Sent over SMTP.")

with smtplib.SMTP("smtp.euromail.dev", 587) as s:
    s.starttls(context=ssl.create_default_context())
    s.login("apikey", os.environ["EUROMAIL_API_KEY"])
    s.send_message(msg)

Node.js (Nodemailer)

import nodemailer from "nodemailer";

const transport = nodemailer.createTransport({
  host: "smtp.euromail.dev",
  port: 587,
  secure: false, // STARTTLS upgrade on 587; use port 465 + secure:true for implicit TLS
  auth: { user: "apikey", pass: process.env.EUROMAIL_API_KEY },
});

await transport.sendMail({
  from: "[email protected]",
  to: "[email protected]",
  subject: "Hello from EuroMail",
  text: "Sent over SMTP.",
});

Laravel

MAIL_MAILER=smtp
MAIL_HOST=smtp.euromail.dev
MAIL_PORT=587
MAIL_USERNAME=apikey
MAIL_PASSWORD="${EUROMAIL_API_KEY}"
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=[email protected]

Django

EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"
EMAIL_HOST = "smtp.euromail.dev"
EMAIL_PORT = 587
EMAIL_USE_TLS = True
EMAIL_HOST_USER = "apikey"
EMAIL_HOST_PASSWORD = os.environ["EUROMAIL_API_KEY"]
DEFAULT_FROM_EMAIL = "[email protected]"

Ruby on Rails (ActionMailer)

config.action_mailer.smtp_settings = {
  address:        "smtp.euromail.dev",
  port:           587,
  user_name:      "apikey",
  password:       ENV["EUROMAIL_API_KEY"],
  authentication: :plain,
  enable_starttls_auto: true,
}

Systems, scripts, and devices

msmtp (sendmail replacement on Linux servers)

# ~/.msmtprc
account        euromail
host           smtp.euromail.dev
port           587
auth           on
tls            on
tls_starttls   on
user           apikey
password       em_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
from           [email protected]

account default : euromail

Symlink /usr/sbin/sendmail to msmtp and legacy apps, cron jobs, and php mail() send through EuroMail with no further changes.

Printers, scanners, NAS, and monitoring

Multifunction printers, NAS boxes (Synology, QNAP), backup software, and monitoring systems (Grafana, Zabbix, Uptime Kuma) all have an "SMTP server" or "email notification" form. Enter:

  • Server / Host: smtp.euromail.dev
  • Port: 587 (STARTTLS) or 465 (SSL/TLS)
  • Username: apikey
  • Password: your API key
  • Sender / From: an address on your verified domain

587 vs 465

Both are fully supported and equally secure -- pick whichever your client offers:

  • 587 (STARTTLS) -- connects in plaintext, then upgrades to TLS via the STARTTLS command. The modern default; use it unless your client only offers SSL.
  • 465 (implicit TLS / SMTPS) -- the connection is encrypted from the first byte. Common on older devices and some plugins (labelled "SSL").

AUTH is only advertised after the connection is encrypted, so credentials are never sent in the clear on either port.

What happens to your message

A message submitted over SMTP is treated identically to one sent via POST /v1/emails:

  • DKIM signed with your domain's key, SPF-aligned from EuroMail's IPs, DMARC-passing.
  • Checked against your suppression list -- previously bounced or unsubscribed recipients are dropped before sending.
  • Open and click tracking applied per your account settings.
  • Visible in the dashboard, with delivery, bounce, and complaint events delivered to your webhooks.

It shows up in your sending stats and counts toward your plan's volume the same way an API send does.

Troubleshooting

SymptomCause and fix
535 5.7.8 Authentication credentials invalidUsername must be the literal apikey; password must be a valid, active API key with the emails:send scope. Regenerate the key if unsure.
Connection times out / refusedYour network may block outbound 587/465 (common on residential ISPs and some clouds). Try the other port, or send from a host with outbound SMTP allowed.
Message rejected -- domain not verifiedThe From address must use a domain you have verified. See Domain Verification.
AUTH not offeredThe client tried to authenticate before TLS. Ensure STARTTLS (587) or implicit TLS (465) is enabled -- EuroMail only advertises AUTH after the connection is encrypted.
Recipient never received itCheck the dashboard for the message's status. A bounced or suppressed status explains a non-delivery; sent/delivered means the recipient's mail server accepted it (check their spam folder).

See also

Send your first email in about 90 seconds

The free tier includes 1,000 emails a month. All data stays in Finland | GDPR compliance without the paperwork.

Create free account See live delivery data