Secure SMTP Configuration

Connect Your SMTP Server

Enter your SMTP credentials below to connect and manage your email server. Your credentials are never stored on our servers — 100% private.

SSL Encrypted No Data Stored Setup in 60s

Email SMTP Details

Fill in your server configuration below to establish a connection.

Documentation

How to use the SMTP form

Follow these steps to connect any SMTP server and start sending emails in minutes.

1 Setup Steps

  1. Enter the website domain (e.g. domain.com or sub.domain.com)
  2. Enter the SMTP host (e.g. smtp.gmail.com)
  3. Enter the SMTP port (e.g. 587 or 465)
  4. Enter the username (usually your email address)
  5. Enter the password or app password

2 Field Reference

subject

Defines the email subject line shown to the recipient.

to

Recipient email. If empty, emails go to the SMTP username.

text

Plain text version of the email. Used when no HTML is provided.

html

HTML formatted content. Falls back to text if left empty.

dynamic fields

Any extra input (name, phone, company) is auto-included in the email.

HTML Form
<form data-mailtree="true">
    <input type="text" name="name" placeholder="Full Name" required>
    <input type="email" name="email" placeholder="Email" required>
    <input type="text" name="phone" placeholder="Phone (optional)">
    <input type="text" name="subject" placeholder="Subject (optional)">
    <input type="text" name="company" placeholder="Company (optional)">

    <textarea name="message" placeholder="Message" required></textarea>

    <button type="submit">Send</button>
</form>

<script src="https://mailtree.vercel.app/mailtree.js"></script>
JavaScript
document.getElementById("contactForm")
  .addEventListener("submit", async (e) => {
    e.preventDefault();

    const formData = new FormData(e.target);
    const data = {};

    formData.forEach((value, key) => {
      data[key] = value;
    });

    const res = await fetch(
      "https://mailtree.vercel.app/send",
      {
        method: "POST",
        headers: { "Content-Type": "application/json" },
        body: JSON.stringify(data)
      }
    );

    const result = await res.json();
    alert(result.message || "Email sent successfully!");
});

Note: The form supports dynamic fields. Any input with a name attribute will be sent automatically to the Mailtree API endpoint.