Form to email
Form to email means sending what a visitor submits on a website form to an email address, so the site owner receives each message in their inbox.
Also called: contact form to email, HTML form to email, email form, form mailer
A page in a browser cannot send email. HTML has no “send mail” tag, and a script on the page has no safe way to hold the credentials of a mail account. Something on a server has to take the submission and write the email. All the ways to get a form into an inbox differ in who runs that server.
The options
- A
mailto:link. It opens the visitor’s own email program with a draft. It works only if they have one configured, loses any structure, and gives you no record or spam filtering. It is a link, not a form. - Your own server code. A PHP script, a serverless function or a small app that receives the post and sends mail through an SMTP service. You control everything, and you also own spam handling, validation, storage, retries and keeping the code up to date.
- A form backend. You point the form’s action at a hosted form backend that does the receiving, spam filtering and sending, so a static site can have a working contact form.
What makes the email arrive
Sending is the easy part. Landing in the inbox depends on sender authentication and reputation, covered under email deliverability. Send notifications from an address on a domain you control, set the visitor’s address as the reply-to so you can answer with one click, and never use the visitor’s address as the sender.
In StaticForm
Add an email action to the form. Set one or more recipients, an optional reply-to and a subject, and write the body with the visual email builder or a template that uses the submitted fields, such as {{form.name}}. A recipient can also be a field value, for example {{form.email}}, to send a confirmation to the person who submitted. Mail can come from a custom domain verified with DKIM or from your own SMTP server, and uploaded files can be attached. Spam submissions skip the email action.
Learn more
Related terms
- Form backendA form backend is a service that receives what a website form submits, then validates it, stores it, filters spam and sends it on to email, a spreadsheet or another tool.
- Email deliverabilityEmail deliverability is the likelihood that an email reaches the recipient's inbox instead of the spam folder or being rejected. Sender authentication is a large part of it.
- Form actionThe form action is the HTML attribute that holds the URL a form is sent to when the visitor submits it. Without it, the form posts to the page it is on.
- WebhookA webhook is an HTTP request that one system sends to a URL you provide when an event happens, so the receiving system learns about it right away instead of asking.