Mailtree API Guide

Mailtree is a high-performance email sending solution that comes with a developer-friendly interface. Just provide your SMTP details and send emails via API call.

Base URL

https://mailtree.vercel.app/
POST

/send-email

Request Payload (Required)

Param Name Description
smtp_host SMTP Host address (e.g. Gmail: smtp.gmail.com)
smtp_port Port Number (587 or 465)
smtp_user Email Address of sender
smtp_pass SMTP Password / Google App Password
to Recipient email address
subject Subject line of the email

Implementation Code

fetch('https://mailtree.vercel.app/send-email', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    smtp_host: "smtp.gmail.com",
    smtp_port: 587,
    smtp_user: "your@email.com",
    smtp_pass: "app-password",
    to: "receiver@email.com",
    subject: "Mailtree API Test",
    text: "This is a test email sent via Mailtree API"
  })
}).then(res => res.json()).then(console.log);

Important Information

  • Always use App Password for Gmail.
  • If you are using port 465, set the secure parameter to true.
  • The API returns a standard JSON response.