Multi-account SMTP
Connect several sending accounts with app passwords and pick one per email.
A case study in building outreach email on top of the sender's own SMTP accounts, with templates, per-send audit logs and two levels of access, in a TypeScript MERN stack.

MERN Mail is a MERN email campaign manager I built in TypeScript so outreach for lead generation goes out from real mailboxes, from reusable templates, with a record of every send.
Users connect their own SMTP accounts with app passwords, write reusable templates and send through Nodemailer, and every email is written to an audit log. Admins oversee all users and the global log, and dashboards chart send statistics for both roles. It runs on React, Node.js and MongoDB with JWT and bcrypt authentication and a crypto-secured forgot-password flow.
The point of the design is that mail never leaves through a third-party bulk sender. It goes out from the mailbox a recipient can reply to, and the app keeps the shared record that a personal inbox cannot.
Cold outreach for lead generation is repetitive work done by hand in an ordinary inbox, and once a team shares it, nobody can say for sure what has already been sent.
The same introduction gets pasted again and again, sent from whichever account happens to be signed in, with no shared record of who was contacted and when. Once more than one person does it, the team loses track of what has gone out.
Bulk-mail services solve the volume but send from their own infrastructure, which is not what outreach from a person's real mailbox needs. The tool I wanted kept mail going out through the sender's own accounts, made templates reusable, and gave whoever ran the operation a single view of every message sent by every user.
| Before MERN Mail | With MERN Mail |
|---|---|
| The same introduction pasted by hand again and again | Reusable templates written once |
| Mail sent from whichever account is signed in | Several SMTP accounts, chosen per send |
| No shared record of who was contacted | An audit log entry for every email |
| No oversight across the people doing outreach | An admin view of all users and the global log |
The brief I set myself
I built MERN Mail across the whole stack in TypeScript, from the React interface to the Node.js API, the MongoDB data model and the Nodemailer sending pipeline.
That covered the React interface with Tailwind CSS and shadcn/ui, the Node.js API, the MongoDB data model, authentication and password reset, the Nodemailer sending pipeline, and the statistics dashboards for users and admins.
Much of the work sat at the boundaries: what the server is allowed to hold for a user's mailbox, what each role is allowed to read, and how a single send becomes both a delivered email and a log entry.
| Frontend | The React interface with Tailwind CSS and shadcn/ui, including the statistics dashboards for users and admins. |
|---|---|
| API | The Node.js API, with every route checking the role carried in the token. |
| Data | The MongoDB model for users, SMTP accounts, templates and the audit log. |
| Sending | The Nodemailer pipeline, sending through the SMTP account picked for each email. |
| Security | JWT authentication, bcrypt password hashing and a crypto-secured password reset. |
A send in MERN Mail follows the same four steps every time: connect a mailbox, write a template, send through the chosen account, and find the message in the log.
Step 1
The user adds an SMTP account with an app password generated by their email provider. Several accounts can be connected.
Step 2
Outreach messages are saved as reusable templates, so the introduction is written once rather than pasted into every email.
Step 3
The user picks one of their connected accounts for the send, and Nodemailer delivers the email through that account's SMTP server.
Step 4
The send is recorded with the sender and the account it went through. The user sees their own entries, and an admin sees every entry.
The features split between the person sending outreach and the admin overseeing it, and both read from the same audit log.
Connect several sending accounts with app passwords and pick one per email.
Save outreach messages as reusable templates instead of pasting them into every email.
Each email goes out through the selected account, so replies come back to a real inbox.
Every send is recorded with its sender and account, per user and globally for admins.
Charts of send statistics, built from the same log as the history.
Users manage their own outreach, and admins oversee every user and the global log.
Token-based sessions that carry the role, and passwords stored only as bcrypt hashes.
Profile management and a forgot-password flow secured with tokens from Node's crypto module.
Four decisions shaped MERN Mail: sending from the user's own SMTP accounts, keeping the access model to two roles, logging every send, and typing both ends.
Delivery
Sending through each user's SMTP account means the email arrives from a real mailbox the recipient can reply to, and the user's sent folder stays a true record. A user can connect several accounts and choose one per send. Accounts are added with app passwords, so the main account password never enters the app and an app password can be revoked from the provider without touching anything else.
Access
The access model is deliberately small: a User manages their own SMTP accounts, templates and sent mail, and an Admin can see every user and the global email log. Two levels covered what the product needed, and every API route checks the role from the token rather than trusting what the interface chooses to show. For a three-tier version of the same idea, see the Team Management System, which separates Admin, Manager and Team Member.
Data
Each email the app sends is recorded with the sender and account it went through. Users read their own entries, and admins read all of them. The dashboard statistics are built from the same log, so the charts and the history can never disagree about how much mail went out.
Types
Templates, accounts, log entries and users pass between React and the API many times in a single session. Writing both ends in TypeScript caught mismatched fields while I was building, before they could reach a send.
| Technology | What it does in MERN Mail |
|---|---|
| React.js | The interface: templates, SMTP accounts, logs, profile and the statistics dashboards. |
| Node.js | The API that stores accounts and templates, sends mail and scopes every query by role. |
| TypeScript | Shared shapes for templates, accounts, log entries and users on both ends. |
| MongoDB | Users, SMTP accounts, templates and the single audit log collection. |
| Tailwind CSS | Styling for the dashboard and every management screen. |
| Shadcn/UI | Accessible form, table and dialog components, restyled with Tailwind CSS. |
| JWT | Authentication, carrying the role that every API route checks. |
| Nodemailer | Sending each email through the SMTP account the user selected. |
| bcrypt | Password hashing, so passwords are never stored in plain text. |
| crypto | Random, unguessable tokens for the forgot-password links. |
Three of the hard parts: holding credentials for someone else's mailbox, a password reset that cannot be guessed, and one log serving two audiences.
Problem
To send as a user, the server needs SMTP credentials for that user's account. Asking people for their real email password would be a serious risk for them and an obvious reason not to use the tool.
Solution
Accounts are connected with app passwords instead. An app password only works for mail access, is generated by the email provider, and can be revoked there at any moment, so a user stays in control of what the app can do with their mailbox.
Problem
Forgot-password links are a common way into an account. A reset link built from anything predictable, such as a user ID or a timestamp, can be forged by someone who never had access to the inbox.
Solution
Reset tokens are generated with Node's crypto module, so the link carries a random value that cannot be derived from anything about the user. Passwords themselves are stored only as bcrypt hashes.
Problem
Users need to see what they sent, and admins need to see everything. Two separate logs would drift apart, and a single log returned in full to everyone would expose each user's outreach to the others.
Solution
There is one log collection, and the API scopes every query by role: a User's request is filtered to their own entries, an Admin's is not. The same scoping feeds the dashboard charts, so each person sees statistics only for the mail they are allowed to see.
MERN Mail turns outreach into a repeatable process: write a template once, send it from the right account, and find every message afterwards in one log.
An admin can review that log across the whole team, and each user sees exactly their own share of it. MERN Mail shares its stack with my Transaction Tracker finance app, but the hard parts here were different: credentials for third-party mailboxes, delivery through external SMTP servers, and an audit trail that had to hold up for oversight.
Ideas for a next version include scheduled sends and per-recipient personalisation fields in templates, which would need to be confirmed before they are described as planned.
Short answers to the questions people ask most about MERN Mail, how it sends email, and how it treats mailbox credentials.
MERN Mail is an email campaign manager for lead generation outreach. Users connect their own SMTP accounts, write reusable templates and send through them, every email is written to an audit log, and admins can oversee all users and the global log.
A TypeScript MERN stack: React with Tailwind CSS and shadcn/ui, Node.js and MongoDB, with Nodemailer for sending, JWT for authentication, bcrypt for password hashing and Node's crypto module for password reset tokens.
Through Nodemailer, using the SMTP account the user picks for that send. The email arrives from a real mailbox the recipient can reply to, rather than from a bulk-mail service.
No. Accounts are connected with app passwords generated by the email provider. An app password only gives mail access and can be revoked at the provider at any time, so the main account password never enters the app.
An admin can see every user and the global email log. A regular user sees only their own SMTP accounts, templates and sent mail, and the API applies that scope to every query, including the dashboard statistics.
They share a TypeScript MERN stack, but MERN Mail is about sending through external SMTP servers and keeping an audit trail for oversight, while Transaction Tracker is a private record of one person's income and spending.
Muhammad Abdullah Awais, a full-stack developer based in Pakistan. I built MERN Mail across the stack, and I am available for freelance and full-time work on applications like it.
A TypeScript MERN finance tracker with categorised transactions, live charts, custom reports and an admin panel.
Read the case studyA MERN team management system with Admin, Manager and Team Member roles, a Kanban board and per-role analytics.
Read the case studyA multilingual Next.js tools platform with 340+ localized pages and country-specific tax logic in 7 languages.
Read the case studyI work remotely with teams in the US, Canada, the UK, Europe and the Gulf, and with clients across Pakistan. Based in Pakistan (PKT, UTC+5), available for freelance and full-time roles.