1.0.3 • Published 7 months ago
@jubayer_shuvo/mailer-js v1.0.3
📬 @jubayer_shuvo/mailer-js
A lightweight and easy-to-use Node.js mailer utility supporting TypeScript and JavaScript.
✨ Features
- 🚀 Simple and minimal API
- 📦 Works with both CommonJS and ESModules
- 📜 Written in TypeScript
- 💌 Send emails with just one function
📦 Installation
npm install @jubayer_shuvo/mailer-js
# or
yarn add @jubayer_shuvo/mailer-jsGet Api for free
🚀 Usage
✅ CommonJS (Node.js)
const sendMail = require("@jubayer_shuvo/mailer-js");
sendMail({
apiKey: "your-api-key",
to: "recipient@example.com",
subject: "Hello!",
text: "This is a test email.",
})
.then(() => console.log("Email sent successfully!"))
.catch(console.error);✅ ESModules / TypeScript
import sendMail from "@jubayer_shuvo/mailer-js";
await sendMail({
apiKey: "your-api-key",
to: "recipient@example.com",
subject: "Hello!",
text: "This is a test email.",
});📄 API
sendMail(options: SendMailOptions): Promise<{ success: boolean }>
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
apiKey | string | ✅ | Your email API key |
to | string | ✅ | Recipient email address |
subject | string | ✅ | Email subject |
text | string | ✅ | Email plain text content |
📃 License
MIT © Md Jubayer