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
| Setting | Value |
|---|---|
| Host | smtp.mail.land |
| Port 587 | Submission with STARTTLS (required) |
| Authentication | Required |
| Username | Any value (e.g., your email, or apikey) |
| Password | Your MailLand API key |
| Max message size | 15 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
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:
| Limit | Default |
|---|---|
| Connections per minute | 30 |
| Connections per hour | 300 |
These limits apply before authentication. If exceeded, the connection is rejected with a message to retry later.
SMTP Response Codes
| Code | Meaning |
|---|---|
250 | Message accepted for delivery |
421 | Transient: credential or workspace rate limit, quota, or warmup pacing exceeded. Retry later; this is not a permanent rejection |
451 | Temporary: 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 |
550 | Permanent: 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) |
552 | Permanent: 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 accountA permanent rejection looks like:
550 5.7.1 Domain is not verified. Add DNS records at https://app.mail.landUnlike 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
| Feature | REST API | SMTP Relay |
|---|---|---|
| Protocol | HTTPS | SMTP |
| Authentication | X-API-Key header | SMTP AUTH (key as password) |
| Response | Async (202 Accepted) | Sync (250 OK or error) |
| Attachments | Base64 in JSON | Standard MIME |
| Templates | templateId field | Not supported (use MIME) |
| Scheduled sending | scheduledAt field | Not supported |
| Tracking | tracking field | Configured per-domain |
| Per-recipient variables | to[].variables | Not supported |
| Batch sending | send-batch endpoint | Not 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