Skip to main content
mailers.io

SMTP relay

SMTP relay credentials and rate limits

By mailers.io team Published 5 min read

Once your app can reach the relay on the right port, the next questions are practical. What do you sign in with, how much can you push through a connection, and what do the error codes mean when you hit a limit? This post covers the credentials and the limits that the mailers.io SMTP relay enforces.

What an SMTP key is

To send over SMTP you create an SMTP key in the app. It is one of two kinds of account key. The other kind is the API key used for the HTTP API. They are stored in the same list but are not interchangeable.

  • An SMTP key carries one scope, send, and no other value is accepted.
  • It authenticates only on the SMTP relay. It does not work on the /api/v3 HTTP API.
  • An API key does not work on the relay either, even when it has the send scope.

The secret begins with mio_live_. It is shown once, when you create the key. The platform stores only a hash of it and an eight-character hint, so nobody, including support, can read it back. If you lose it, create a new key and revoke the old one. The key’s creation needs a recent step-up check, and the account owner receives a security e-mail when any key is created.

SMTP relay access is part of every current plan. If a plan did not include it, the key would stop signing in.

Signing in

The relay offers PLAIN and LOGIN authentication, and only after TLS is on. Use the key’s username and secret as shown in the app. Every failure, whether the key is malformed, unknown, revoked, expired or of the wrong kind, gets the same reply, 535 5.7.8. That uniform answer is deliberate: it stops anyone from learning whether a guessed key exists.

Repeated failures from one client address are throttled, so a script stuck in a retry loop with a wrong secret will be slowed down rather than allowed to hammer the server.

Expiry and revocation

A key can have an expiry date. Seven days before it lapses, the account owner gets a notice in the account centre. After expiry the key simply stops authenticating.

Revoking a key works immediately, including for connections that are already open. The relay checks the key again at every MAIL FROM. If the key was revoked or expired, or the account was suspended, in the middle of a session, the server answers 530 5.7.0 and the client has to authenticate again, which then fails. Do not assume that an open session keeps a revoked key alive.

Revoked and expired keys are removed from the system 90 days later.

One key per application

Make a key for each app or environment that sends. If a staging server leaks its key, you can revoke only that one. Names help: a key called after the application it serves is easy to find in the list later. Set an expiry on keys you only need for a while, such as a migration or a contractor’s test.

There is a limit of 50 live keys per kind per account, and key creation is itself rate limited to 20 per hour. Neither should get in the way of ordinary use.

Limits on a connection and a message

The relay protects itself and your account with a handful of fixed limits.

Limit Value What the client sees
Messages per connection 100 421, then reconnect
Recipients per message 50 452 4.5.3, split the message
Simultaneous connections per key 10 454 past the limit
Attachments, total size 25 MB by default 552 5.3.4 if over the total
Attachments, number of files 10 refused

A well-behaved client handles these without drama. Most libraries reuse one connection for a batch and reconnect when asked. If you send a newsletter-sized batch, open a few connections in parallel rather than one very long one, and keep within the ten per key.

The recipient limit counts the people in the SMTP envelope. The relay ignores Cc and Bcc headers when it decides who receives the message, so a header can never add a recipient. List everyone as an envelope recipient.

Attachments

Attachments are supported on the relay. The total size is capped by a platform setting, which defaults to 25 MB, and a message can carry up to ten files. Files are kept for seven days while the message is sent, then removed. Some file types are refused outright, such as executables, scripts, disk images, and HTML or SVG files; the reply is 554 5.6.1. Inline images that use a cid: reference are supported.

The HTTP API does not take attachments. If you need them, the relay is the route. See SMTP relay or API for how to choose.

Rate limits

SMTP and the HTTP API draw from the same buckets. By default an account gets 600 requests per minute, the plan can change that figure, and each key has its own limit too. A key that is throttled on one path is throttled on the other. When the relay rate limits you, it answers 451 4.7.0 with the number of seconds to wait. A normal client queues the message and retries after that delay, so you do not need special code, but it is worth knowing that a very large burst will be spread out.

Credits and suppression

Each recipient that is sent uses one credit, the same as any other send. A recipient on your suppression list is skipped and costs nothing. If the account has run out of credits, the relay answers 452 4.3.1 and the client should retry later or you can add a credit pack.

Sending rate is also bound by your own servers. The relay accepts a message and passes it to your rotation of servers, each with its own limits. See daily limits per mailbox and server for how those interact.

Reading the errors

  • 535 5.7.8: authentication failed. Check the username, the secret and the key’s kind.
  • 530 5.7.0: the key stopped working during the session. Authenticate again, or make a new key.
  • 452 4.5.3: too many recipients in one message.
  • 452 4.3.1: out of credits, or too much unsent attachment data waiting.
  • 451 4.7.0: rate limited. Wait the number of seconds given.
  • 421: too many messages on one connection. Reconnect.

Treat a 4xx as temporary, and retry. A 5xx means the message itself was refused and a retry will fail the same way.

Where to go next

The general rules for keeping keys safe, including how scopes work for API keys, are in API key scopes and key hygiene. The SMTP relay page has the short version of everything here.

Questions and answers

Can I use an SMTP key on the HTTP API?

No. SMTP keys and API keys are different kinds of credential. Each works only on its own path, even if the scope looks right.

How many SMTP keys can I have?

Up to 50 live keys of each kind per account. Expired keys do not count against that.

Do Cc and Bcc headers add recipients?

No. Only the recipients named in the SMTP envelope receive the message. A header never adds anyone.

Written by the mailers.io team. Published .

Keep reading

Related posts

Send cold e-mail from your own servers.

Connect your servers, import a list and write the steps. Replies stop the sequence.

  • 7-day money-back guarantee
  • Bring your own providers
  • Cancel anytime