Skip to content

SMTP relay

The relay accepts standard SMTP/ESMTP, authenticates your per-project credential, and routes the message through your attached providers. If you just want to send your first mail, start with the quickstart — this page is the full reference.

Host: smtp.mailway.net

Port Protocol Notes
587 SMTP + STARTTLS Submission, upgraded to TLS before login. The most widely supported.
465 SMTPS (implicit TLS) Submission over TLS from the first byte, the current standard (RFC 8314). Use it if your library supports it.
25 SMTP + STARTTLS Standard relay port.
2525, 2587, 588 SMTP + STARTTLS Alternates for clouds that block the standard ports.
2465 SMTPS (implicit TLS) Alternate for 465.

Seven ports because outbound SMTP is blocked more often than people think: GCP blocks outbound port 25 to external destinations, DigitalOcean blocks 25, 465, and 587 by default, AWS blocks 25 by default, and plenty of corporate networks filter the rest. On DigitalOcean, a port that answers over IPv4 can still hang over IPv6. Whatever your platform allows out, one of these gets through — same host, same credentials.

  • Mechanisms: PLAIN and LOGIN.
  • TLS first, always. The server refuses AUTH on a plaintext connection — negotiate STARTTLS on the submission ports, or connect with implicit TLS on 465/2465.
  • Credentials are per-project (concepts): a credential sends through its own project’s providers and nothing else.
  • What the pair looks like: the username is mw_user_ + the credential’s ID core (e.g. mw_user_01k8w9qz3f7m2xv5tj6b4n8dqr) — the same identifier the console shows for the row, so logs and support tickets line up. The password is mw_pass_ + 40 random characters and is the only secret of the pair — if a string starting mw_pass_, mw_live_ or mw_test_ ever lands in a repository, revoke it.
  • AUTH rejected, or the connection won’t open? The usual causes — authenticating before STARTTLS (538), a blocked port, or a transient throttle (454) — are mapped to fixes in troubleshooting.

Mailway answers EHLO with the same capability list on every port, apart from TLS and authentication. On the STARTTLS ports (25, 587, 588, 2525, 2587), before STARTTLS:

250-mailway.net Hello app.yourcompany.com [203.0.113.7], ready when you are
250-PIPELINING
250-8BITMIME
250-SMTPUTF8
250-ENHANCEDSTATUSCODES
250-SIZE 26214400
250 STARTTLS

After STARTTLS, and from the start on the implicit-TLS ports (465, 2465):

250-mailway.net Hello app.yourcompany.com [203.0.113.7], ready when you are
250-PIPELINING
250-8BITMIME
250-SMTPUTF8
250-ENHANCEDSTATUSCODES
250-SIZE 26214400
250 AUTH PLAIN LOGIN

On smtp.mailway.dev the first line names mailway.dev. Nothing else is offered: no delivery status notifications (DSN), REQUIRETLS, or CHUNKING. A parameter the list doesn’t offer is refused with 555 5.5.4 and its name, for example 555 5.5.4 RET parameter not supported. That includes DSN’s RET and ENVID and REQUIRETLS on MAIL FROM, and DSN’s NOTIFY and ORCPT on RCPT TO.

Mailway accepts SMTPUTF8. Whether a provider can send a mail with a non-ASCII address depends on the provider.

A message can be up to 25 MB in total: 26,214,400 bytes, the number EHLO advertises as SIZE 26214400. A mail can have up to 1,000 recipients; for the rest Mailway answers 452 4.5.3 Too many recipients. A mail server sends those recipients in another mail on its own. An app library (nodemailer, PHPMailer, or Symfony Mailer) doesn’t, so keep each mail to 1,000 recipients. Both limits are commitments: Mailway won’t lower them. Your providers can have lower limits of their own, listed in the provider guides under Limits. A team can have up to 128 SMTP sessions open at once, across all its credentials (16 on the sandbox). One connection carries up to 1,000 mails and stays open for up to 1 hour; after that Mailway answers 421 and your mailer has to open a new connection. The replies your mailer can see from Mailway’s SMTP relay. Each one also carries an enhanced status code after the number (535 5.7.8 Authentication failed), which mail servers log and libraries report:

Code Meaning What to do
250 2.0.0 Received as …, safe with Mailway Mailway received and stored the message. The text after Received as is the mail ID (m.…): the console shows the mail under it, and webhook events carry it as data.mail.uid. Paste it into the console’s search to open the mail. Nothing: routing to your providers starts now.
421 4.3.2 / 4.3.0 Service shutting down: Mailway is restarting the relay. A mail whose data Mailway has fully received gets its 250 first, unless storing it stalls. One still being sent when the restart’s 30 seconds run out gets no reply and isn’t stored, so your mailer retries it. Service busy: Mailway couldn’t take the connection for a moment. Temporary local error (4.3.0): an error on Mailway’s side before the session started. Temporary. Reconnect and retry. A mail server does this on its own.
421 4.4.2 The connection sat idle for 2 minutes, a command line took longer than a minute, a message took longer than 10 minutes or arrived too slowly, or the connection was open for an hour. Temporary. Reconnect. Open a new connection for mail after a long pause.
421 4.7.0 / 4.7.1 Too many connections: your team’s sessions (in reply to AUTH), your host’s, the port’s, or the relay’s; or too many new connections or failed authentication attempts from your host; or your host’s IP address is on a blocklist (4.7.1). Temporary. Retry with backoff; reuse one connection for several messages. More
451 4.3.0 Mailway couldn’t take the message right now. Nothing was stored. Temporary. Retry with backoff. A mail server does this on its own; with an app library (nodemailer, PHPMailer, Symfony Mailer), your app has to retry. More
452 4.7.0 / 4.3.1 / 4.5.3 The daily send limit is reached, the relay is short of disk space, or a mail has more than 1,000 recipients (452 4.5.3). Temporary. If the text says Daily send limit reached, retry after 00:00 UTC. If it says Insufficient system storage, retry with backoff. More
454 4.7.0 Authentication is briefly unavailable. Temporary; your credential is fine. Retry with backoff. More
454 4.7.0 TLS not available Your mailer sent STARTTLS and the relay had no certificate to offer. Temporary. Retry with backoff. The relay doesn’t take mail without TLS, so don’t fall back to plaintext.
500 / 501 5.5.x / 502 / 503 / 504 / 554 5.5.0 Your mailer broke the SMTP exchange: a command Mailway doesn’t know or support, a command out of order or with bad syntax, an AUTH mechanism other than PLAIN or LOGIN, or commands sent ahead where SMTP says to wait for the reply (554 5.5.0 SMTP protocol synchronization error, which also ends the connection). Permanent, for that command. Check your mailer’s SMTP settings and its log.
501 5.1.7 / 5.1.3 A sender or recipient address isn’t valid, such as a,b@example.com. Permanent, for that address. Correct the address. More
530 5.7.0 Authentication required Your app sent MAIL FROM without authenticating first. Permanent. Set the SMTP username and password in your mailer, and make sure it uses TLS.
530 5.7.0 This SMTP credential was revoked. … The credential was revoked while the connection was open. Within a minute of the revoke, Mailway refuses the next mail on that connection. Permanent. Create a new credential in the project’s Access section and switch your app to it. More
535 5.7.8 The username and password don’t match an active SMTP credential. Permanent. Check the credential in the project’s Access section. More
538 5.7.11 AUTH was sent before TLS. Use STARTTLS, or implicit TLS on 465/2465. More
550 5.7.0 A monthly plan limit is spent (message quota or data volume), or the team is a person’s second Free team (the text then starts This team is on the Free plan). Permanent. Wait for the month to roll over, add an add-on, or upgrade. Such a team sends once it’s on a paid plan. More
550 5.1.7 Null sender … The envelope sender is empty (MAIL FROM:<>), as in a bounce or an auto-reply. Mailway hands each mail to your provider from that address, so it needs one. Permanent. Set MAIL FROM to an address on a domain your provider has verified. More
552 5.3.4 The message is larger than 25 MB. Permanent. Host large attachments and link them. More
554 5.6.0 The message has no From header field, or contains a NUL byte, or a header line ends in a bare carriage return or starts with a dot. Nothing was stored. Permanent. Add a From field naming the author; encode binary data as base64; end every header line with CRLF and start it with a field name. More
555 5.5.4 Your mailer sent a MAIL FROM or RCPT TO parameter the relay doesn’t offer (see What the relay offers). The text names it: 555 5.5.4 NOTIFY parameter not supported. Permanent. Turn off delivery status notifications (DSN) or REQUIRETLS in your mailer.

A 421 ends the connection, never just one mail. Mailway sends one of these texts. On 465 and 2465, a connection that Mailway turns away before TLS starts is closed without a reply, so your mailer reports a closed connection instead of a 421. This covers the host’s, the port’s and the relay’s connection limits, the failed-authentication lockout, the blocklist, Service busy, and a local error.

  • 421 4.3.0 Temporary local error, please retry
  • 421 4.3.2 Service shutting down, please retry
  • 421 4.3.2 Service busy, please retry in a moment
  • 421 4.4.2 Timeout, closing the connection
  • 421 4.4.2 Data arrived too slowly, closing the connection
  • 421 4.4.2 Connection open too long, please reconnect
  • 421 4.7.0 Too many SMTP sessions for this team at once, please retry in a moment
  • 421 4.7.0 Too many connections from your host, please retry in a moment
  • 421 4.7.0 Too many new connections from your host, please retry in a moment
  • 421 4.7.0 Too many connected clients, please retry in a moment
  • 421 4.7.0 Too many mails on one connection, please reconnect
  • 421 4.7.0 Not authenticated in time, closing the connection
  • 421 4.7.0 Too many errors, closing the connection
  • 421 4.7.0 Too much input, closing the connection
  • 421 4.7.0 You sent data before the greeting, closing the connection
  • 421 4.7.1 Too many failed authentication attempts from your host, please retry later
  • 421 4.7.1 Your IP address is on a blocklist; if this is wrong, write to hello@mailway.net

Too many mails on one connection and Connection open too long are the connection limits above: open a new connection. Not authenticated in time, Too many errors, Too much input, and You sent data before the greeting mean your mailer didn’t follow the SMTP exchange. It didn’t authenticate within 2 minutes, sent too many commands Mailway didn’t recognize or couldn’t use, sent a lot of input without waiting for replies, or spoke before Mailway’s greeting. Check your mailer’s SMTP settings and its log. The causes and fixes for the other 4.7.0 and 4.7.1 replies are in troubleshooting.

Mailway’s core promise is byte-for-byte fidelity: the message your app hands over is the message your provider receives, apart from the four automatic exceptions below. Mailway’s archive keeps the message with the header fixes and line endings below already applied; the other two exceptions happen only on the way to a provider. Concretely:

  • No tracking pixels, no link rewriting, no footer injection. Ever. Open/click tracking mutates your message and breaks DKIM alignment; Mailway doesn’t do it.
  • The message is parsed for the console (search, preview, analytics) and archived byte-for-byte — the parsing never feeds back into what’s sent.
  • Your DKIM signature, if you sign before handing off and sign the standard way (over CRLF line endings, below), reaches your provider intact, and the archive keeps it as received. Mailway checks it shortly after receiving the mail and keeps the result, because a signature can only be checked while its key is still published. What the provider then does to its own copy varies by provider: Amazon SES replaces Message-ID and Date; Mailtrap, Brevo, Mailjet, and MailerSend add tracking to HTML; MailerSend appends a footer; SMTP2GO’s SMTP delivered it unchanged, your signature passing; see Deliverability.

One other case can change what a provider receives, and it is opt-in, per project, off by default: a provider account that can only send over an API that can’t accept a raw message (one set to Send via: API only, say) can relay only by re-encoding — which an admin must explicitly enable, accepting that the delivered copy may not be 100% identical to the original. Relayed mail skips such an account otherwise. Accounts that can send over SMTP relay over SMTP. Which APIs carry raw bytes, which can’t, and exactly what re-encoding does: SMTP mail through API providers.

Header names that start with X-Mailway- are reserved for Mailway. Today such a header passes through to your provider like any other. A later release will read these headers and remove them before the mail goes to your provider, so don’t use the prefix for headers of your own. The send endpoint (POST /v1/send) already refuses such a header (request fields). A raw message sent to POST /v1/send/mime keeps it, as SMTP mail does.

Your app gets its 250 (Received as …) when Mailway receives and stores the message — then routing happens asynchronously. If the first provider refuses the send (a rejected key, exhausted credits, a throttle), Mailway retries through the project’s provider chain; your app doesn’t see provider failures, and the console shows every attempt. One ordering is specific to relayed mail: accounts that relay over SMTP are tried first, then accounts that relay over a raw-capable API, and re-encoding accounts last, whatever the project’s routing strategy — byte-fidelity outranks strategy preference.

For staging and CI, point the same SMTP config at smtp.mailway.dev with your normal project credential — the same relay, a different hostname. Mail there is captured: stored and fully visible in the console, but never forwarded to a provider. Nothing reaches a real recipient unless you explicitly release a capture. See Sandbox for the capture-and-release flow, or the HTTP API sandbox if you’re testing over HTTP.