📧 Email Sending API Documentation
🔑 Your API Key
Get Api Key🚀 Send Email Endpoint
Send an email using your linked Gmail, Outlook and Zoho account.
POST https://mailer-js.vercel.app/api/send-mail-external
Content-Type: application/json
{
apiKey: "apiKey",
to: "freind@example.com",
subject": "Greetings from JSCoder",
text: "Hello, this is a test email sent via API."
}📄 Package Documentation
📦 Installation
npm install @jubayer_shuvo/mailer-js🚀 Usage
✅ CommonJS
const sendMail = require("@jubayer_shuvo/mailer-js");
sendMail({
apiKey: "apiKey",
to: "freind@example.com",
subject: "Greetings from JSCoder",
text: "Hello, this is a test email sent via API.",
}).then(() => console.log("Email sent!")).catch(console.error);✅ ESModules / TypeScript
import sendMail from "@jubayer_shuvo/mailer-js";
await sendMail({
apiKey: "apiKey",
to: "freind@example.com",
subject: "Greetings from JSCoder",
text: "Hello, this is a test email sent via API."
}).then(() => console.log("Email sent!")).catch(console.error);📋 API Parameters
- apiKey
(string, required): Your API key. - to
(string, required): Recipient's email address. - subject
(string, required): Email subject. - text
(string, required): Email body text.
✅ Success Response
{
"success": true
}❌ Error Responses
- 400 - Missing fields or parameters.
- 403 - Invalid API Key.
- 500 - Internal Server Error.