MailLandDocs

SMTP Relay

Send emails through Mail.Land's SMTP relay using standard SMTP protocols

MailLand provides an SMTP relay for applications that send email via SMTP. Use the same API credentials to authenticate and send through standard SMTP ports.

Connection Settings

SettingValue
Hostsmtp.mail.land
Port 587Submission with STARTTLS (required)
AuthenticationRequired
UsernameAny value (e.g., your email, or apikey)
PasswordYour MailLand API key
Max message size15 MiB (15,728,640 bytes); larger messages are refused with 552

Only port 587 (STARTTLS) is published for the relay in production. Port 465 (implicit TLS) is not published, and port 25 is routed to the separate inbound gateway, not the relay.

Authentication

SMTP authentication uses your MailLand API key as the password. The username can be any value: MailLand ignores it and authenticates solely based on the API key.

Your credential must have the Smtp channel enabled. If your credential only has Api enabled, SMTP authentication will be rejected.

Username: apikey
Password: ml_pet_Ab3Kx9mN2pQ7rT4wL8yD...

Your account email and password are not accepted for SMTP. Create an SMTP credential in the panel and use it as the password.

Configuration Examples

nodemailer-config.js
const nodemailer = require('nodemailer');

const transporter = nodemailer.createTransport({
  host: 'smtp.mail.land',
  port: 587,
  secure: false, // STARTTLS
  auth: {
    user: 'apikey',
    pass: 'ml_pet_Ab3Kx9mN2pQ7rT4wL8yD...',
  },
});

await transporter.sendMail({
  from: '"Your App" <[email protected]>',
  to: '[email protected]',
  subject: 'Hello from MailLand',
  html: '<h1>Hello!</h1><p>Sent via SMTP relay.</p>',
  text: 'Hello! Sent via SMTP relay.',
});

Credential Enforcement

The same credential rules apply to SMTP as to REST API:

  • Stream: transactional credentials limit to 5 recipients per message; marketing credentials allow up to 1,000 recipients per message
  • Domain scope: if the credential is scoped to specific domains, the sender domain must be in the allowed list
  • IP whitelist: if the credential has IP restrictions, the connecting IP must be allowed
  • Rate limits: the credential's per-minute (if set), per-hour (default 1,000) and per-day (default 10,000) limits are enforced before your workspace's plan limits. Exceeding one returns a transient 421. The per-second limit is not enforced today.
  • Mode: sandbox credentials accept and record the email but never deliver it, whatever their sandboxBehavior

IP Connection Limits

Independent of credential rate limits, SMTP connections are rate-limited per IP address:

LimitDefault
Connections per minute30
Connections per hour300

These limits apply before authentication. If exceeded, the connection is rejected with a message to retry later.

SMTP Response Codes

CodeMeaning
250Message accepted for delivery
421Transient: credential or workspace rate limit, quota, or warmup pacing exceeded. Retry later; this is not a permanent rejection
451Temporary: sending is paused by a volume spike, a marketing pause or a deliverability hold. Keep the message queued and retry; it is accepted once the pause is lifted
550Permanent: domain not verified, sender/recipient blocked, verification required, or the marketing recipient limit (1,000 per message) exceeded, or all recipients are suppressed (5.7.1)
552Permanent: message exceeds the 15 MiB size limit, its attachments exceed 10 MiB in total once decoded, or the assembled message exceeds the platform's message budget (5.3.4)

Error Handling

When a message is rejected, the SMTP response includes a human-readable reason. A transient (retry) rejection looks like:

421 Try again later: rate limit exceeded
421 Try again later: monthly quota exceeded
421 Try again later: credential rate limit exceeded
451 4.7.0 Marketing emails are paused for this account

A permanent rejection looks like:

550 5.7.1 Domain is not verified. Add DNS records at https://app.mail.land

Unlike the REST API (which returns 202 Accepted and processes asynchronously), SMTP can reject messages synchronously at the connection level for domain, rate limit, and quota violations.

SMTP vs REST API

FeatureREST APISMTP Relay
ProtocolHTTPSSMTP
AuthenticationX-API-Key headerSMTP AUTH (key as password)
ResponseAsync (202 Accepted)Sync (250 OK or error)
AttachmentsBase64 in JSONStandard MIME
TemplatestemplateId fieldNot supported (use MIME)
Scheduled sendingscheduledAt fieldNot supported
Trackingtracking fieldConfigured per-domain
Per-recipient variablesto[].variablesNot supported
Batch sendingsend-batch endpointNot supported

Next Steps

  • REST API: send emails via the REST API
  • API Keys: configure SMTP channel on your credentials
  • Domain Setup: configure DNS records for your sending domain

On this page