A simple and quick email sending package for Node.js. Built on top of Nodemailer with sensible defaults for Gmail.
Don't have a Node.js server? No problem! Use our web app to send emails instantly without any backend or server setup:
https://quick-mail.remainderzero.com/
Perfect for:
- Frontend-only projects
- Quick email testing
- No server infrastructure needed
- Send emails directly from your browser
Create a free account and start sending emails without any hassle!
npm install quick-mailimport { QuickMail } from "quick-mail";
// Initialize with your Gmail credentials
QuickMail.init({
email: "your-email@gmail.com",
password: "your-gmail-app-password",
});
// Send an email
const result = await QuickMail.send({
to: "recipient@example.com",
subject: "Hello from QuickMail!",
html: "<h1>Welcome!</h1><p>This is a test email.</p>",
});
if (result.success) {
console.log("Email sent!", result.messageId);
} else {
console.error("Failed:", result.error);
}| Option | Type | Default | Description |
|---|---|---|---|
email |
string | required | Your email address used for sending (SMTP username) |
password |
string | required | SMTP password. For Gmail, use App Password from Google Account |
smtpHost |
string | smtp.gmail.com |
SMTP server hostname |
smtpPort |
number | 587 |
SMTP server port (587 for TLS, 465 for SSL) |
smtpSecure |
boolean | auto | Use SSL/TLS connection (auto-detects: false for 587, true for 465) |
senderName |
string | - | Display name shown in recipient's inbox |
| Option | Type | Required | Description |
|---|---|---|---|
to |
string | array | yes | Recipient email(s) |
subject |
string | yes | Email subject |
html |
string | yes* | HTML content (*or text required) |
text |
string | yes* | Plain text (*or html required) |
from |
string | - | Sender (defaults to email) |
cc |
string | array | - | CC recipients |
bcc |
string | array | - | BCC recipients |
replyTo |
string | - | Reply-to address |
attachments |
Attachment[] | - | File attachments |
await QuickMail.send({
to: "friend@example.com",
subject: "Hello!",
html: "<p>How are you?</p>",
});await QuickMail.send({
to: ["user1@example.com", "user2@example.com"],
cc: "manager@example.com",
subject: "Team Update",
html: "<p>Here's the weekly update...</p>",
});await QuickMail.send({
to: "client@example.com",
subject: "Invoice",
html: "<p>Please find the invoice attached.</p>",
attachments: [
{ filename: "invoice.pdf", path: "./invoice.pdf" },
{ filename: "readme.txt", content: "Hello World!" },
],
});QuickMail.init({
email: "your-email@outlook.com",
password: "your-password",
smtpHost: "smtp.office365.com",
smtpPort: 587,
});QuickMail.init({
email: "noreply@company.com",
password: "password",
senderName: "Company Name",
});
// Emails will show: "Company Name" <noreply@company.com>// Verify SMTP connection
const isConnected = await QuickMail.verify();
// Check if initialized
const ready = QuickMail.isInitialized();
// Reset/disconnect
QuickMail.reset();To use with Gmail, you need an App Password:
- Go to Google Account Security
- Enable 2-Step Verification
- Go to App Passwords
- Generate a new app password for "Mail"
- Use that 16-character password in the
passwordfield
MIT