# Form SMTP: send form emails through your own SMTP server

> How to send website form submissions through your own SMTP server: the settings you need, three ways to set it up, and how to keep form emails out of spam.

Source: https://formsmtp.com/form-smtp · Last updated October 26, 2026

“Form SMTP” means sending the emails your website forms produce (contact messages, quote requests, signups) through an SMTP server you control, such as your Gmail, Google Workspace, Microsoft 365 or Zoho mailbox, or a sending service like Amazon SES or Brevo, instead of a form tool’s shared sender. Here’s why it matters, what you need, and the three ways to set it up.

## Why send form emails through your own SMTP?

- **Your address, your domain.** Notifications come from you@yourdomain.com rather than a no-reply address on someone else’s domain.
- **Better inbox placement.** Mail sent by your own authenticated account passes SPF, DKIM and DMARC for your domain, so inbox providers trust it.
- **Your sender reputation.** You don’t share an IP or a reputation with every other customer of a form service.
- **Your limits, your logs.** Sending volume is whatever your mailbox or provider allows, and every message shows up in your own Sent folder or provider logs.

## The SMTP settings a form needs

Whichever way you connect a form, you’ll be asked for the same six things. Your provider publishes them; the most common ones are on our [SMTP settings page](https://formsmtp.com/smtp-settings).

| Setting | What to enter | Example (Gmail) |
| --- | --- | --- |
| SMTP host | Your provider’s outgoing server | `smtp.gmail.com` |
| Port | `465` (SSL/TLS) or `587` (STARTTLS) | `465` |
| Encryption | SSL on for 465, off for 587 (it upgrades with STARTTLS) | SSL on |
| Username | Usually your full email address; some services use a fixed name or SMTP login | you@gmail.com |
| Password | An app password or SMTP key, rarely your normal password | 16-character App Password |
| From address | An address your SMTP account is allowed to send as | you@gmail.com |

## Three ways to set up form SMTP

### 1. Your form builder’s custom SMTP setting

Many hosted form builders let you replace their sender with your own SMTP server, often under a setting called *Custom SMTP* (Zoho Forms, for example, has it under *Settings → General → SMTP*), and sometimes only on paid plans. On WordPress, plugins such as WP Mail SMTP reroute every email the site sends, including form notifications, through an SMTP provider. Use this if your forms already live in one of these tools.

### 2. Your own backend

If you run a server, a few lines of Nodemailer (Node.js), PHPMailer (PHP) or smtplib (Python) can send each submission through your SMTP account. You keep full control, but you also write and host the code, keep the SMTP password on the server, and build spam protection and rate limits yourself.

### 3. A form endpoint that uses your SMTP

For static sites and site builders, where there’s no server to run SMTP code, point the form at an endpoint that holds your SMTP login and sends for you. That’s what FormSMTP does: your SMTP password stays encrypted on our side, and the page only contains a project key that can email nobody but you.

## Set up form SMTP in five minutes

1. [Create a free FormSMTP account](https://app.formsmtp.com/#/signup) and add a project. Pick your provider so the host and port fill in, enter your username and app password, and click *Test connection*.
2. Under *Settings → Security*, set **Allowed websites** to your site and **Allowed recipients** to your own address.
3. Point your form at the project’s form URL. It works with no JavaScript:

```html
<form action="https://app.formsmtp.com/api/v1/form/YOUR_API_KEY" method="POST">
  <label>Name <input name="name" required></label>
  <label>Email <input name="email" type="email" required></label>
  <label>Message <textarea name="message" rows="5" required></textarea></label>

  <input type="hidden" name="_subject" value="New message from my website">
  <input type="hidden" name="_next" value="/thanks.html">
  <!-- Honeypot: hidden from people, irresistible to bots -->
  <input type="text" name="_gotcha" style="display:none" tabindex="-1" autocomplete="off">

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

Each submission is emailed to you **from your own address**, through your SMTP server, with the visitor’s email as **Reply-To**, so hitting Reply answers them directly. Using a framework? See the guides for [Next.js](https://formsmtp.com/guides/nextjs-contact-form), [React](https://formsmtp.com/guides/react-contact-form), [Vue](https://formsmtp.com/guides/vue-contact-form) and [plain JavaScript](https://formsmtp.com/guides/send-email-from-javascript).

## Keep form emails out of spam

- **Never send “from” the visitor.** Putting the visitor’s address in From is spoofing their domain: it fails DMARC and lands in spam or gets rejected. Send from your own address and put the visitor in Reply-To.
- **Match From to the SMTP account.** The From address should be the mailbox you log in with, or an alias or domain your provider has verified.
- **Publish SPF and DKIM** for your domain, plus a DMARC record. Your email provider gives you the exact DNS entries.
- **Block bots.** A hidden honeypot field like `_gotcha` above stops most spam submissions without a CAPTCHA.

## Common form SMTP errors

| Error | What it usually means |
| --- | --- |
| `535` authentication failed | Wrong username or password, or the provider wants an app password or SMTP key instead of your normal password. |
| `553` / `550` sender rejected | The From address isn’t one your SMTP account may send as. Use your own login address or a verified alias. |
| Connection timed out | The port is blocked. Use 465 or 587 rather than 25, and check the host for your region. |
| Wrong version number / TLS error | SSL setting doesn’t match the port: SSL on for 465, off for 587. |

Provider-specific fixes are in the guides for [Gmail](https://formsmtp.com/guides/gmail-smtp-contact-form), [Outlook & Microsoft 365](https://formsmtp.com/guides/outlook-smtp-contact-form), [Zoho](https://formsmtp.com/guides/zoho-smtp-contact-form), [Amazon SES](https://formsmtp.com/guides/amazon-ses-smtp-contact-form) and [Brevo](https://formsmtp.com/guides/brevo-smtp-contact-form).

## FAQ

### Do I need SMTP for a contact form?

Not strictly: many form services send from their own servers. But a form that sends through your own SMTP account delivers from your own address and domain, which makes the emails more trustworthy to inbox providers and keeps your sender reputation in your hands.

### Can I use Gmail SMTP for my website form?

Yes. Use smtp.gmail.com on port 465 (SSL) or 587 (STARTTLS) with an App Password, which needs 2-Step Verification on the account. Free Gmail allows roughly 500 recipients a day, which is plenty for contact forms.

### Which SMTP port should a form use?

Port 465 (TLS from the start) or 587 (STARTTLS). Avoid port 25: it is meant for server-to-server mail and is often blocked by hosting providers.

### Why do my form emails go to spam?

Usually because the From address is the visitor’s email, or a domain your SMTP account isn’t allowed to send for. Send from your own authenticated address, put the visitor in Reply-To, and publish SPF and DKIM records for your domain.

### Can a static site use form SMTP?

Not directly, because a static site has no server to talk SMTP. Point the form at a form endpoint that holds your SMTP login and sends for you, such as FormSMTP, which needs no backend code.
