HTML contact form without PHP or a server (2026 tutorial)
By Maxime Branger · Published on
The problem
An HTML form cannot send an email on its own. Without PHP or a server, there are two usual options. The first is a mailto: link, which opens the visitor's email client — if they even have one set up. The second is to write and host a backend. AirMess offers a third way: your form sends the data to a URL, and you receive an email.
Step 1: create the form on AirMess
Create an account on AirMess, then a new form. Enter the address that will receive the messages and add your domain to the list of allowed origins. Copy the form URL.
Step 2: add the form to your page
<form action="https://airmess.fr/api/submit/YOUR_TOKEN" method="POST">
<label for="name">Name</label>
<input id="name" name="name" type="text" required>
<label for="email">Email</label>
<input id="email" name="email" type="email" required>
<label for="message">Message</label>
<textarea id="message" name="message" rows="5" required></textarea>
<button type="submit">Send</button>
</form> That's it: this form works without JavaScript. On submission, the browser leaves the page and the visitor lands on a confirmation page hosted by AirMess. To bring them back to your site, fill in “Redirect URL after submission” in the form settings, for example your /thank-you page.
Would you rather keep the visitor on the page and show a confirmation message in place of the form? Follow the Contact form without page reload (fetch) tutorial.
Troubleshooting
If the submission is refused (error page or 403 error), your domain is not in the list of allowed origins. Remember this for your local tests too. To block bots, turn on hCaptcha in the form settings.
The full code of this tutorial is available on GitHub.