Learn how to send emails to your Mailoverse subdomain using SMTP, Nodemailer, Python smtplib, or email APIs like SendGrid and Postmark. Complete configuration examples.
Sending Emails
Mailoverse receives emails sent to any address at your subdomain. You can send emails using SMTP, email APIs, or any method your application already uses.
The Any-Address Pattern
A key feature of Mailoverse is that any address at your subdomain is valid. You don't need to pre-create mailboxes. Simply send to any address and it will be stored:
test@yoursubdomain.mailoverse.com user-123@yoursubdomain.mailoverse.com signup-flow@yoursubdomain.mailoverse.com reset-password-test@yoursubdomain.mailoverse.com This is especially useful for testing. Generate unique email addresses per test run to avoid conflicts between parallel tests:
// Generate unique email per test
const testEmail = `test-${Date.now()}-${Math.random().toString(36).slice(2)}@yoursubdomain.mailoverse.com`;SMTP Configuration
To send emails via SMTP, configure your application or mail library with your SMTP provider's settings. The recipient address should be at your Mailoverse subdomain.
Node.js with Nodemailer
import nodemailer from 'nodemailer';
const transporter = nodemailer.createTransport({
host: 'smtp.your-provider.com',
port: 587,
secure: false,
auth: {
user: 'your-smtp-username',
pass: 'your-smtp-password',
},
});
await transporter.sendMail({
from: 'noreply@yourapp.com',
to: 'test@yoursubdomain.mailoverse.com',
subject: 'Test Email',
text: 'This is a test email for Mailoverse.',
html: '<p>This is a <strong>test email</strong> for Mailoverse.</p>',
});Python with smtplib
import smtplib
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
msg = MIMEMultipart('alternative')
msg['Subject'] = 'Test Email'
msg['From'] = 'noreply@yourapp.com'
msg['To'] = 'test@yoursubdomain.mailoverse.com'
text = 'This is a test email for Mailoverse.'
html = '<p>This is a <strong>test email</strong> for Mailoverse.</p>'
msg.attach(MIMEText(text, 'plain'))
msg.attach(MIMEText(html, 'html'))
with smtplib.SMTP('smtp.your-provider.com', 587) as server:
server.starttls()
server.login('your-smtp-username', 'your-smtp-password')
server.send_message(msg)Email API Providers
If you're using an email API provider, configure the recipient to be your Mailoverse address. Here are examples for popular providers:
SendGrid
import sgMail from '@sendgrid/mail';
sgMail.setApiKey(process.env.SENDGRID_API_KEY);
await sgMail.send({
to: 'test@yoursubdomain.mailoverse.com',
from: 'noreply@yourapp.com',
subject: 'Test Email',
text: 'This is a test email.',
html: '<p>This is a <strong>test email</strong>.</p>',
});Resend
import { Resend } from 'resend';
const resend = new Resend(process.env.RESEND_API_KEY);
await resend.emails.send({
from: 'noreply@yourapp.com',
to: 'test@yoursubdomain.mailoverse.com',
subject: 'Test Email',
html: '<p>This is a <strong>test email</strong>.</p>',
});Mailgun
import formData from 'form-data';
import Mailgun from 'mailgun.js';
const mailgun = new Mailgun(formData);
const mg = mailgun.client({
username: 'api',
key: process.env.MAILGUN_API_KEY,
});
await mg.messages.create('yourapp.com', {
from: 'noreply@yourapp.com',
to: 'test@yoursubdomain.mailoverse.com',
subject: 'Test Email',
text: 'This is a test email.',
html: '<p>This is a <strong>test email</strong>.</p>',
});Postmark
import postmark from 'postmark';
const client = new postmark.ServerClient(process.env.POSTMARK_API_KEY);
await client.sendEmail({
From: 'noreply@yourapp.com',
To: 'test@yoursubdomain.mailoverse.com',
Subject: 'Test Email',
TextBody: 'This is a test email.',
HtmlBody: '<p>This is a <strong>test email</strong>.</p>',
});Tips for Testing
- Use unique addresses per test — Include timestamps or UUIDs in the local part to ensure each test has its own mailbox.
- Poll with timeout — Email delivery isn't instant. Poll the API with a reasonable timeout (e.g., 30 seconds) and backoff.
- Check your quota — Monitor your email quota in the dashboard. Emails are counted when received, not when retrieved.
- Use environment variables — Store your API key and subdomain in environment variables for security and flexibility.
Next Steps
- API Reference — Learn about the email retrieval endpoint in detail.
- Code Examples — See complete examples for various languages and testing frameworks.