Mailtree Logo

Email SMTP Details

Enter your SMTP configuration details below to connect and manage your email server.




Documentation

How to use the SMTP configuration form:


  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)
  4. Enter the username (email address)
  5. Enter the password or app password

  1. Subject (name="subject"): Defines the email subject line that will be shown to the recipient

  2. To (name="to"): Recipient email address. If left empty, emails will be sent to the SMTP username

  3. Text (name="text"): Plain text version of the email content. Used when no HTML is provided

  4. HTML (name="html"): HTML formatted email content. If empty, the text version will be used instead

  5. Dynamic Fields (any name="..."): Any additional form inputs (e.g. name, phone, company) are automatically included in the email

Example Frontend Form Submit (HTML Form)

<form data-mailtree="true">
    <input type="text" name="name" placeholder="Full Name" required>
    <input type="email" name="email" placeholder="Email Address" 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>


Example Frontend Form Submit (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: Form supports dynamic fields. Any input with a name attribute will be sent automatically to the Mailtree API endpoint.

Any Help to Contact