Skip to content
mavimail

Connect your application

mavimail speaks plain SMTP, so any framework or library that can send email can use it. You only change the mail settings of your development or test environment.

In four steps

  1. Create an account and an inbox

    Register, then create a project and an inbox in it. One inbox per application or environment keeps things apart.

  2. Copy the SMTP credentials

    Open the inbox. Its SMTP credentials and ready-made snippets for common frameworks are on the inbox page.

  3. Enter them in your application

    Replace the SMTP host, port, username and password in the configuration of your test environment. The settings are listed below.

  4. Send a test message

    Trigger any email in your application. It appears in the inbox within moments, without reloading the page.

SMTP settings

Username and password are different for every inbox. Treat them like any other secret and keep them out of your repository.

SettingValue
Hostsmtp.mavimail.dev
Port2587, 2465, 2525
UsernameShown on the inbox page
PasswordShown on the inbox page
AuthenticationPLAIN or LOGIN

Ports and encryption

All ports accept the same credentials. Use the port with required STARTTLS unless your setup cannot do TLS.

PortEncryption
2587STARTTLS required before sign-in. Recommended.
2465Implicit TLS from the first byte (SMTPS).
2525STARTTLS optional. The only port that also accepts a sign-in without TLS – meant for local setups.

Examples

Replace {username} and {password} with the values of your inbox. The app shows these snippets with your real credentials filled in, for more frameworks than listed here.

Symfony Mailer.env.local
MAILER_DSN=smtp://{username}:{password}@smtp.mavimail.dev:2587?require_tls=true
Laravel.env
MAIL_MAILER=smtp
MAIL_HOST=smtp.mavimail.dev
MAIL_PORT=2587
MAIL_USERNAME={username}
MAIL_PASSWORD={password}
Node.js (Nodemailer)mailer.js
import nodemailer from 'nodemailer';

export const transport = nodemailer.createTransport({
  host: 'smtp.mavimail.dev',
  port: 2587,
  secure: false,
  requireTLS: true,
  auth: { user: '{username}', pass: '{password}' },
});
Djangosettings.py
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.mavimail.dev'
EMAIL_PORT = 2587
EMAIL_USE_TLS = True
EMAIL_HOST_USER = '{username}'
EMAIL_HOST_PASSWORD = '{password}'
swaks (shell)Shell
swaks --server smtp.mavimail.dev:2587 --tls \
  --auth-user '{username}' --auth-password '{password}' \
  --from app@example.com --to customer@example.org

Read an inbox in your mail program

On paid plans you can read an inbox over IMAP in Apple Mail, Thunderbird, Outlook or on your phone. Switch on “IMAP access active” on the inbox page, tab “Mail client (IMAP)” – the username and the IMAP password are shown there. Automatic account setup does not find mavimail, so set up the account manually.

SettingValue
Incoming serverimap.mavimail.dev
Port2993
EncryptionSSL/TLS
UsernameSame as for SMTP, shown on the inbox page
PasswordThe IMAP password of the inbox, not the SMTP password

Set up the account

  1. Apple Mail (Mac, iPhone, iPad)Add an account with “Other Mail Account” and enter a name, any email address (Mail only displays it) and the IMAP password. Choose IMAP, enter imap.mavimail.dev as incoming server and the username. If Mail does not ask for the port, set port 2993 with SSL/TLS afterwards in the server settings of the account (on iPhone and iPad under Advanced).
  2. ThunderbirdCreate a new email account with a name, any address and the IMAP password, then choose “Configure manually”. Incoming server: IMAP, imap.mavimail.dev, port 2993, SSL/TLS, normal password and the username of the inbox.
  3. OutlookAdd an account, enter any address and pick IMAP in the advanced or manual setup. Incoming mail: server imap.mavimail.dev, port 2993, encryption SSL/TLS, then the username and the IMAP password. The new Outlook, classic Outlook and Outlook for Mac ask for the same fields.
  4. Other programs and AndroidChoose IMAP with manual setup and enter server imap.mavimail.dev, port 2993, SSL/TLS, the username and the IMAP password.

Good to know

No outgoing server needed
The account is only for reading; your application keeps delivering over SMTP. If the program insists on an outgoing server, enter smtp.mavimail.dev with the SMTP credentials of the inbox – messages sent that way land in the inbox, never with real recipients.
Two folders
INBOX holds the messages, Trash is the trash of the inbox (many programs show it under their own name). Further folders cannot be created.
Deleting moves to the trash
Deleting a message in the mail program moves it to the trash, as in the app, where it stays for 7 days. Deleting it in Trash or emptying the trash removes it for good; moving it back to INBOX restores it. Read and unread stay in sync both ways.
iPhone and iPad
iOS does not keep the connection open in the background: new messages appear when you open Mail or it fetches new data. On the Mac, in Thunderbird and in Outlook they show up within seconds.
Port blocked
Some company networks only allow standard ports. If the program cannot reach port 2993, try another network.
Sign-in fails
Check that IMAP access is switched on for the inbox and included in your plan, and use the IMAP password, not the SMTP password. After a new IMAP password or new SMTP credentials, sign in again with the current data.

Forwarding to real inboxes

Sometimes a test message has to reach a real mailbox, for example to check it in a mail client. mavimail forwards only to addresses and domains your organization has confirmed. Owners and admins manage targets in the organization settings and rules in the settings of each inbox.

Confirm an address
Add the address as a target. mavimail sends a confirmation link to it, valid for 72 hours. Nothing is forwarded until someone opens the link and confirms.
Confirm a domain
Add the domain and create the TXT record _mavimail-verify.<domain> with the value shown in the settings, then check it. A confirmed domain covers the addresses directly at that domain, not its subdomains.
Forward by hand or by rule
Forward a single message from the message view, or set up rules per inbox. A rule can match a recipient pattern such as *@example.org and sends to at most 10 recipients per message.
What the forwarded message looks like
The body stays as it is. From becomes "<sender> via mavimail" with the mavimail forwarding address, Reply-To is the original sender, and X-Mavimail-Original-From and X-Mavimail-Forwarded show where it came from.
Limits
Every recipient counts against the forwards per month of your plan, also for rules. Failed deliveries are not credited back. The numbers per plan are on the pricing page.
Confirmations expire
A confirmed address stays valid for 12 months; 14 days before, mavimail sends a new confirmation link. Domains are checked every 30 days – if the TXT record is missing twice, the domain has to be confirmed again.
503 Forwarding is turned off
The operator can switch forwarding off as a whole. Setting up targets and rules and forwarding then return this error; your existing targets and rules stay.

Trash

Deleted messages are not gone at once: they stay in the trash of their inbox for 7 days.

Deleting moves to the trash
Deleting a message or emptying an inbox – in the app or with DELETE /messages/<id> and POST /inboxes/<id>/clear – moves the messages to the trash. Messages in the trash do not count against the messages per inbox.
Restore or delete for good
Restore a message in the app or with POST /messages/<id>/restore. DELETE /messages/<id>?permanent=true deletes at once, POST /inboxes/<id>/trash/empty empties the trash.
After 7 days
Messages in the trash are deleted permanently after 7 days, earlier if the retention period of your plan ends first. A message in the trash cannot be forwarded until it is restored.

If something does not arrive

535 Authentication credentials invalid
Username or password are wrong. After a reset of the credentials the old pair stops working at once – copy the new one from the inbox page.
552 Message size exceeds limit
The message is larger than your plan allows. The limits are listed on the pricing page.
451 Rate limit exceeded
Your organization sent more messages in a short time than its plan allows. Wait a few seconds and send again.
550 Monthly message quota exceeded
Your organization has used up its emails for this month. Sending works again from the first day of the next month, or right away with a larger plan.

Ready to try it?

Create a free account and your first inbox in a few minutes.