A modern command-line tool for sending emails through SMTP.
Configure your SMTP account once, then send emails with attachments to one or multiple recipients directly from your terminal.
MailerJS-CLI is a lightweight command-line tool for sending emails through SMTP. It provides a simple, interactive way to configure an email provider, compose plain text emails, HTML emails, or reusable HTML templates, attach files, and send emails to one or multiple recipients directly from your terminal.
Whether you're sending job applications, notifications, newsletters, or bulk emails, MailerJS-CLI streamlines the process with recipient validation, TXT file imports, HTML email support, reusable HTML templates, SMTP connection testing, and persistent configuration.
- π§ Interactive email sending
- π Plain text email support
- π HTML email support
- π Reusable HTML template support
- π Browse available HTML templates
- π·οΈ Dynamic placeholder replacement
- π₯ Send to multiple recipients
- π₯ CC & BCC recipient support
- π Import recipients from TXT files
- π Multiple attachment support
- βοΈ One-time SMTP configuration
- βοΈ Interactive configuration editor
- π View current SMTP configuration
- π Remove saved SMTP configuration
- β‘ SMTP connection testing
- π Built-in SMTP provider presets
- π Custom SMTP server support
- β Automatic email validation
- π Automatic duplicate removal
- π¨ Beautiful interactive CLI
- β³ Progress spinners
- π Sending summary
- π Secure SMTP authentication
- πΎ Persistent local configuration
- Gmail
- Outlook
- Yahoo
- Zoho Mail
- iCloud
- Custom SMTP
npm install -g mailerjs-cli- Node.js 18+
- npm
Verify your installation:
node -v
npm -vConfigure your SMTP account:
mailer configView the current configuration:
mailer config --currentEdit an existing configuration:
mailer config --editReset the saved configuration:
mailer config --removeTest your configuration:
mailer testView available email templates:
mailer templatesStart MailerJS:
mailerDuring the interactive session you can:
- Compose plain text emails.
- Send HTML emails from files.
- Use reusable HTML templates.
- Enter recipients manually.
- Import recipients from a TXT file.
- Add CC and BCC recipients.
- Attach one or multiple files.
- Review everything before sending.
| Command | Description |
|---|---|
mailer |
Start the interactive email sender |
mailer config |
Configure SMTP settings |
mailer config --edit |
Edit an existing SMTP configuration |
mailer config --current |
Display the current SMTP configuration |
mailer config --remove |
Delete the saved SMTP configuration |
mailer templates |
List all available HTML templates |
mailer test |
Verify SMTP connection |
mailer help |
Show available commands |
mailer version |
Display installed version |
MailerJS can import recipients directly from a plain text file.
Example:
john@example.com
jane@example.com
alex@example.com
support@example.com
Rules:
- One email address per line
- Blank lines are ignored
- Invalid email addresses are skipped automatically
- Duplicate email addresses are removed automatically
- Email addresses are normalized before validation
After importing, MailerJS displays a summary including:
- Total recipients
- Valid email addresses
- Invalid email addresses
- Duplicates removed
MailerJS supports optional CC (Carbon Copy) and BCC (Blind Carbon Copy) recipients.
During the sending process you can choose whether to add CC and/or BCC recipients.
Features:
- Optional CC recipients
- Optional BCC recipients
- Multiple CC recipients
- Multiple BCC recipients
- Email validation for all recipient types
Example:
To:
john@example.com
CC:
manager@example.com
team@example.com
BCC:
archive@example.com
Recipients in CC are visible to everyone receiving the email.
Recipients in BCC remain hidden from all other recipients.
MailerJS-CLI supports sending HTML emails directly from an HTML file.
Choose HTML File as the message format, provide the path to your HTML document, and MailerJS-CLI will load and send it as the email body.
Example:
<!DOCTYPE html>
<html>
<body style="font-family: Arial, sans-serif;">
<h2>Welcome!</h2>
<p>This email was sent using <strong>MailerJS-CLI</strong>.</p>
<a href="https://github.com/MkhalFadel/MailerJS-CLI">
View the Project
</a>
</body>
</html>MailerJS-CLI supports reusable HTML templates with dynamic placeholders.
Templates are stored inside:
~/.mailerjs/templates
To view all available templates:
mailer templatesExample template:
Thank you for applying to {{company}}.
Position: {{position}}
When sending an email, MailerJS-CLI automatically detects every placeholder and prompts you to provide a value.
Example:
name > John
company > OpenAI
position > Backend Developer
The placeholders are replaced before the email is sent, allowing you to reuse the same template with different content.
$ mailer
βββββ βββββ ββββββ ββββββ βββββββββββββββ βββββββββββ
βββββ βββββββββββββββββββ ββββββββββββββββ βββββββββββ
βββββββββββββββββββββββββ ββββββ ββββββββ βββββββββββ
βββββββββββββββββββββββββ ββββββ ββββββββββ βββββββββββ
βββ βββ ββββββ βββββββββββββββββββββββββ βββββββββββββββββββ
βββ ββββββ βββββββββββββββββββββββββ βββ ββββββ ββββββββ
Modern SMTP Email CLI
Email Subject
βββββββββββββ
? > Project Update
Email Message
βββββββββββββ
? Choose format type: Plain text
Type "END" on a new line when finished.
1 β Hello team,
2 β
3 β The latest build has been deployed successfully.
4 β END
Attachments
βββββββββββ
? Include attachments? Yes
? Enter file path:
~/Documents/report.pdf
? Add another attachment? Yes
? Enter file path:
~/Documents/changelog.pdf
? Add another attachment? No
Recipients
ββββββββββ
? How would you like to add recipients?
β― Enter manually
When you finish adding recipients press Enter...
Recipient #1
ββββββββββββ
? > john@example.com
Recipient #2
ββββββββββββ
? > jane@example.com
Recipient #3
ββββββββββββ
? >
βββββββββββββββ
Email Review
Subject:
Project Update
Message:
Hello team,
The latest build has been deployed successfully.
Attachments:
~/Documents/report.pdf
~/Documents/changelog.pdf
Recipients:
john@example.com
jane@example.com
? Send emails? Yes
β Email sent to john@example.com
β Email sent to jane@example.com
Summary
βββββββ
βΉ Total Emails: 2
β Sent: 2
β Failed: 0
Google no longer allows SMTP login using your normal account password.
To use Gmail:
- Enable Two-Factor Authentication.
- Create an App Password.
- Run:
mailer config- Use your Gmail address and the generated App Password.
MailerJS stores its configuration locally inside your home directory.
A new configuration can be created with:
mailer configView the current configuration:
mailer config --currentAn existing configuration can be modified at any time without recreating it:
mailer config --editDelete the current configuration:
mailer config --removeThe interactive editor allows you to update:
- Provider
- SMTP Host (Custom SMTP only)
- SMTP Port (Custom SMTP only)
- Secure connection (Custom SMTP only)
- Email address
- Password
- Sender name
The current configuration viewer displays:
- Provider
- SMTP settings
- Account information
- Sender information
Passwords are always hidden when displayed.
Example configuration:
{
"provider": "Gmail",
"smtp": {
"host": "smtp.gmail.com",
"port": 587,
"secure": false,
"username": "example@gmail.com",
"password": "****************"
},
"sender": {
"name": "John Doe",
"email": "example@gmail.com"
}
}- Node.js
- Nodemailer
- Inquirer
- Chalk
- Ora
- Figlet
- Validator.js
- CSV recipient import
- Default attachment directory
- Scheduled emails
- Verbose mode
- Rate limiting
Clone the repository:
git clone https://github.com/MkhalFadel/MailerJS-CLI.gitInstall dependencies:
npm installlink locally:
npm linkContributions are welcome.
- Fork the repository.
- Create a feature branch.
- Commit your changes.
- Open a Pull Request.
This project is licensed under the MIT License.
See the LICENSE file for details.
Mkhal Fadel
GitHub: https://github.com/MkhalFadel
If you find MailerJS-CLI useful, consider giving the repository a β on GitHub. It helps others discover the project and supports future development.
