Contact Form - Web3Forms
Web3Forms handles form submissions and emails them to the client. Free, no backend, no database.
- Go to web3forms.com
- Enter the client’s email -> get an access key
- Add the key to the form
Full form template
Section titled “Full form template”<form method="POST" action="https://api.web3forms.com/submit" class="space-y-5"> <!-- Required hidden fields --> <input type="hidden" name="access_key" value="YOUR_ACCESS_KEY" /> <input type="hidden" name="subject" value="New enquiry - Business Name" /> <input type="hidden" name="redirect" value="https://domain.com/thank-you" /> <input type="hidden" name="from_name" value="Business Name Website" />
<!-- Honeypot spam filter - must be hidden --> <input type="checkbox" name="botcheck" style="display:none" />
<!-- Visible fields --> <div> <label for="name">Name</label> <input id="name" name="name" type="text" required /> </div>
<div> <label for="email">Email</label> <input id="email" name="email" type="email" required /> </div>
<div> <label for="phone">Phone / WhatsApp</label> <input id="phone" name="phone" type="tel" /> </div>
<div> <label for="message">Message</label> <textarea id="message" name="message" rows="4"></textarea> </div>
<button type="submit">Send Message</button></form>How it works
Section titled “How it works”- User submits the form
- Browser POSTs to
https://api.web3forms.com/submit - Web3Forms emails the submission to the address linked to
access_key - Web3Forms redirects the browser to
redirectURL (/thank-you)
No backend code needed. No API keys to manage in Cloudflare.
Configuration fields
Section titled “Configuration fields”| Field | Required | Description |
|---|---|---|
access_key |
Yes | From web3forms.com for the client’s email |
subject |
Recommended | Email subject line |
redirect |
Recommended | Page to show after submission |
from_name |
Recommended | “From” name in the email |
botcheck |
Yes | Hidden checkbox - prevents spam |
Spam protection
Section titled “Spam protection”The botcheck honeypot field is invisible to humans but bots fill it in. Web3Forms rejects any submission with it checked.
For additional spam protection, Web3Forms also supports hCaptcha (add data-hcaptcha="true" to the form).
The thank-you page
Section titled “The thank-you page”src/pages/thank-you.astro - set noindex={true} and add to robots.txt Disallow. Keep it minimal: confirm the message was received, link back to the homepage.
Testing
Section titled “Testing”Submit the form with real data in your browser. Check the email the access key is linked to. Delivery is typically instant.