🚀 Introduction
Welcome to the integration guide for Email Email. This microservice operates as a centralized email gateway for backend applications. Your services (hosted on Render, AWS, Heroku, or other platforms) can send custom notifications, verification codes, and emails by initiating HTTP requests.
Stateless Design: The service does not store SMTP passwords or login credentials. All SMTP transporter settings are supplied dynamically by the client caller inside the request payload. This allows you to route emails through multiple distinct email accounts or servers dynamically from a single central gateway.
📥 API Reference
The gateway accepts JSON payloads sent via POST.
Endpoint URL: /api/send-email
| Parameter Path | Type | Required | Description |
|---|---|---|---|
smtp.host |
string | ✅ Yes | Hostname of your SMTP server (e.g. smtp.gmail.com). |
smtp.port |
number | ✅ Yes | SMTP port configuration (e.g., 465 or 587). |
smtp.secure |
boolean | ❌ No | Set to true if using SSL (typically port 465). Defaults to false. |
smtp.user |
string | ✅ Yes | The email address used to log into the SMTP server. |
smtp.pass |
string | ✅ Yes | App-specific password generated by your email provider. |
smtp.from |
string | ❌ No | Sender display header tag. e.g., "Support Team . Defaults to smtp.user. |
to |
string | ✅ Yes | Recipient email address. |
subject |
string | ✅ Yes | The subject line of the email. |
text |
string | ❌ No* | Plain-text content body backup. |
html |
string | ❌ No* | HTML formatted body content. |
* At least one of text or html must be provided in the payload.
Success Response (HTTP 200 OK):
{
"success": true,
"message": "Email sent successfully",
"messageId": "<66f272a-d83a-86c4-dcb9@gmail.com>"
}
💻 Integration Code
Select your framework language below to copy pre-formatted implementation code:
const sendEmail = async () => {
const url = 'https://email-email.vercel.app/api/send-email';
const payload = {
smtp: {
host: 'smtp.gmail.com',
port: 465,
secure: true,
user: 'OTP.markethealers@gmail.com',
pass: 'your-gmail-app-password'
},
to: 'recipient@domain.com',
subject: 'OTP Verification Key',
text: 'Your code is 552192'
};
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(payload)
});
const result = await response.json();
console.log(result);
};
curl -X POST https://email-email.vercel.app/api/send-email \
-H "Content-Type: application/json" \
-d '{
"smtp": {
"host": "smtp.gmail.com",
"port": 465,
"secure": true,
"user": "OTP.markethealers@gmail.com",
"pass": "your-gmail-app-password"
},
"to": "recipient@domain.com",
"subject": "cURL Alert",
"text": "This is a test notification."
}'
import requests
url = "https://email-email.vercel.app/api/send-email"
headers = {
"Content-Type": "application/json"
}
payload = {
"smtp": {
"host": "smtp.gmail.com",
"port": 465,
"secure": True,
"user": "OTP.markethealers@gmail.com",
"pass": "your-gmail-app-password"
},
"to": "recipient@domain.com",
"subject": "System Status",
"text": "Service status normal"
}
response = requests.post(url, headers=headers, json=payload)
print(response.json())
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
)
func main() {
url := "https://email-email.vercel.app/api/send-email"
payload := map[string]interface{}{
"smtp": map[string]interface{}{
"host": "smtp.gmail.com",
"port": 465,
"secure": true,
"user": "OTP.markethealers@gmail.com",
"pass": "your-gmail-app-password",
},
"to": "recipient@domain.com",
"subject": "Go Alert",
"text": "Alert triggered from Go service.",
}
jsonValue, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonValue))
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err == nil {
defer resp.Body.Close()
fmt.Println("Status:", resp.Status)
}
}
❓ Configuration FAQ
smtp.pass.
2. Navigate to myaccount.google.com/apppasswords.
3. Generate a password for your App, copy the 16-character code, and use it as
smtp.pass in your JSON requests.
"Billing Department <billing@yourdomain.com>".