HTML form backend: 5 services and a safe PHP contact form
An HTML form backend sends your static site's form to your inbox. Formspree, Basin, Forminit, Web3Forms and Netlify Forms compared, plus a safe PHP version.

An HTML form backend is a service that receives your form’s submissions so you don’t need server code: you point the form’s action at its URL and it filters spam, stores the message and emails you. For most static sites, Web3Forms, Formspree, Basin or Forminit (formerly Getform) are the quickest route, and Netlify Forms is the obvious pick if you already host on Netlify. If your host runs PHP, you can also handle the form yourself, and there’s a safe minimal example below.
| Backend | Free tier | Paid from | File uploads | Stores submissions |
|---|---|---|---|---|
| Formspree | 50 submissions/mo, for testing | Personal $15/mo, or $10/mo yearly | From Personal (1 GB) | Yes, 30-day archive on free |
| Basin | 1 form, 50 submissions/mo | Starter $12.50/mo billed yearly | 100 MB on free | Yes, 30-day retention on free |
| Forminit (formerly Getform) | 1 form, 100 submissions/mo | Pro $16/mo, or $190/yr | 100 MB on free | Yes |
| Web3Forms | 250 submissions/mo, unlimited forms | Pro $12/mo billed yearly ($149/yr) | Pro and up | Dashboard history 30 days on free |
| Netlify Forms | Free and unlimited on credit-based plans | Netlify Personal $9/mo | Yes, 8 MB per request | Yes |
All limits checked October 2026 on each vendor’s own pricing page or docs, in US dollars.
How we judged: free-tier limits, what happens when you go over, file uploads, spam tools and whether you can see past submissions. We used each vendor’s own pricing page and docs, not reviews.
The backends
Formspree
The best known, and the one most “Formspree alternative” searches are trying to replace. You get unlimited forms on every plan, spam filtering, custom reCAPTCHA and domain restriction even on free.
Falls short: the free plan is pitched for testing: 50 submissions a month, a 30-day archive and no file uploads.
Price (checked October 2026): Personal $15/mo or $10/mo billed yearly (200 submissions, 1 GB uploads); Professional $30/mo or $20/mo yearly (2,000, adds advanced spam control and autoresponses); Business $90/mo or $60/mo yearly (20,000, custom honeypot and spam rules).
Suits: developers who want a well-documented service and will pay a little.
Basin
Basin’s free plan gives you one form, 50 submissions a month, 30-day retention, 100 MB of uploads and basic spam protection. Spam doesn’t count toward your limit, and if you go over on a paid plan, submissions are still delivered and billed as overage instead of being dropped.
Falls short: only one form on free, and the stronger spam filters (custom content, language and location filters) start at Pro.
Price (checked October 2026): Starter $12.50/mo billed yearly (3 forms, 250 submissions); Growth $24.17/mo billed yearly (unlimited forms, 1,000); Pro $30.62/mo billed yearly or $40.83 monthly (5,000, 10 GB).
Suits: sites where losing a submission over a limit isn’t acceptable.
Forminit (formerly Getform)
Getform was renamed Forminit in January 2026, according to its pricing page FAQ, so getform.io now redirects there. The free plan includes file uploads, email notifications, a workflow builder, spam protection and an unlimited submission archive.
Falls short: the free plan is one form and 100 submissions a month.
Price (checked October 2026): Pro $16/mo or $190/yr (10 forms, 5,000 submissions, 1 GB); Business $50/mo or $594/yr (unlimited forms, 50,000, 10 GB).
Suits: a single contact form that needs uploads on a free plan.
Web3Forms
The most generous free tier here: 250 submissions a month, unlimited forms and domains, with hCaptcha and honeypot protection. Data is retained per form for up to 3 years on free, though the dashboard only lists the last 30 days.
Falls short: file uploads, reCAPTCHA and Turnstile, autoresponders and webhooks need Pro. If you hit your limit, Web3Forms stops accepting submissions until next month (it warns you at 90% and 100%).
Price (checked October 2026): Pro $12/mo billed yearly, $149 a year (10,000 submissions, 5 GB storage); Agency $33/mo billed yearly, $399 a year (20,000). There’s also a $49-a-year plan for students, startups and non-profits (5,000 submissions, no uploads).
Suits: personal sites and small businesses with steady, modest volume.
Netlify Forms
If your site is on Netlify, add data-netlify="true" to the form and Netlify collects submissions at deploy time. Netlify’s docs say forms are free and unlimited on its credit-based plans (legacy plans are metered). Every submission goes through Akismet, and you can add a honeypot with the netlify-honeypot attribute or a reCAPTCHA 2 challenge.
Falls short: it only works on Netlify. File uploads are capped at 8 MB for the whole request, time out after 30 seconds, and take one file per field.
Price (checked October 2026): Netlify’s Free plan has 300 credits a month, Personal is $9/mo and Pro $20/mo.
Suits: anything already deployed on Netlify.
Doing it yourself with PHP
If your host runs PHP, a contact form is about 40 lines. The hard parts aren’t the code, they’re spam, email delivery and header injection.
mail() vs SMTP, in short
PHP’s mail() hands the message to the server’s local mail program (sendmail on Linux). It returns true if the message was accepted for delivery, and the PHP manual is blunt that this doesn’t mean it will reach anyone. On shared hosting, mail sent this way often isn’t authenticated for your domain, so it can land in spam or never show up.
SMTP means logging in to a real mail provider (your email host or a transactional email service) and sending through it. The provider’s domain records are set up, so delivery is far more reliable. In PHP, the usual way is PHPMailer (composer require phpmailer/phpmailer), which supports SMTP authentication and protects against header injection.
Rule of thumb: mail() is fine for testing and very low volume. Use SMTP for anything you rely on.
Header injection, the bug to avoid
If you put a visitor’s input into an email header and they include a line break, they can add their own headers, such as Bcc:, and use your form to send spam. The PHP manual warns to sanitise any outside data used in headers. Three rules prevent it:
- Keep To and From fixed. Never take them from the form.
- Put the visitor’s address only in Reply-To, and only after it passes email validation.
- Reject any header value that contains
\ror\n.
A minimal, safe example
The form, with a honeypot field that people never see:
<form action="/contact.php" method="POST">
<label>Name <input name="name" required maxlength="100"></label>
<label>Email <input name="email" type="email" required maxlength="254"></label>
<label>Message <textarea name="message" required maxlength="5000"></textarea></label>
<!-- Honeypot: hidden from people, bots fill it in -->
<div style="position:absolute;left:-9999px" aria-hidden="true">
<label>Leave this empty <input name="website" tabindex="-1" autocomplete="off"></label>
</div>
<button type="submit">Send</button>
</form>
And contact.php:
<?php
declare(strict_types=1);
if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
http_response_code(405);
exit('Method not allowed');
}
// 1. Honeypot: if it's filled in, act as if it worked and stop.
if (!empty($_POST['website'])) {
header('Location: /thanks.html');
exit;
}
// 2. Read and validate every field on the server.
$name = trim((string) ($_POST['name'] ?? ''));
$email = trim((string) ($_POST['email'] ?? ''));
$message = trim((string) ($_POST['message'] ?? ''));
$valid = $name !== '' && strlen($name) <= 100
&& filter_var($email, FILTER_VALIDATE_EMAIL) !== false
&& $message !== '' && strlen($message) <= 5000
&& !preg_match('/[\r\n]/', $name . $email); // no header injection
if (!$valid) {
http_response_code(422);
exit('Please check your name, email and message, then try again.');
}
// 3. Fixed To, From and Subject. The visitor's address only goes in Reply-To.
$to = 'you@yourdomain.com';
$subject = 'New message from your website';
$body = "Name: {$name}\nEmail: {$email}\n\n{$message}";
$headers = [
'From' => 'Website <forms@yourdomain.com>',
'Reply-To' => $email,
'Content-Type' => 'text/plain; charset=UTF-8',
];
$sent = mail($to, $subject, $body, $headers);
header('Location: ' . ($sent ? '/thanks.html' : '/error.html'));
exit;
A few notes:
- The
Fromaddress should be on your own domain. Mail that claims to be from the visitor’s Gmail or Outlook address is likely to be flagged, which is why their address goes inReply-Toinstead. - Passing headers as an array needs PHP 7.2 or newer.
- The body is plain text, so a visitor can’t inject HTML into your email.
- To switch to SMTP later, replace the
mail()line with PHPMailer: setisSMTP(), your provider’s host, username, password and port, thensetFrom,addAddress,addReplyTo($email)andsend(). Keep the validation exactly as it is.
Adding a CAPTCHA
A honeypot stops basic bots. For more, add Cloudflare Turnstile: put its widget in the form, and in contact.php, before sending, post secret (your secret key) and response (the cf-turnstile-response value from the form) to https://challenges.cloudflare.com/turnstile/v0/siteverify. Only send the email if it comes back successful. Cloudflare’s docs say each token is valid for 300 seconds and can only be checked once, so verify it right away.
What the DIY route doesn’t give you
The script above emails you and forgets. If the email fails, the message is gone. A backend service (or a database insert before you send) gives you a copy of every submission. That’s the main reason to pay for a backend even if you can write PHP.
How to choose
- Static site, low volume, free: Web3Forms.
- Need uploads on free: Forminit or Basin.
- Can’t afford to drop a submission over a limit: Basin, which bills overage instead of rejecting.
- Hosted on Netlify: Netlify Forms.
- You have PHP hosting and want no third party: the script above, with SMTP and Turnstile.
If you’d rather use a hosted form builder with a visual editor, see the best form builders for websites, and for Webflow-specific options, best form builder for Webflow. Our contact form template shows which fields are worth asking for.
TidyForms is a Shopify app for now. Support for plain HTML sites is coming after the Shopify launch, and you can join the HTML waitlist.
Sources
- Formspree plans (checked October 2026)
- Basin pricing (checked October 2026)
- Forminit pricing (checked October 2026)
- Web3Forms pricing (checked October 2026)
- Netlify pricing (checked October 2026)
- Netlify docs: Forms usage and billing (checked October 2026)
- Netlify docs: Forms setup (checked October 2026)
- Netlify docs: Spam filters (checked October 2026)
- PHP manual: mail() (checked October 2026)
- PHPMailer on GitHub (checked October 2026)
- Cloudflare Turnstile: Server-side validation (checked October 2026)
Questions
What is an HTML form backend?
It's a service that gives you a URL to put in your form's action attribute. When someone submits, the service receives the data, filters spam, stores it and emails you, so a static site doesn't need its own server code.
What's a good free Formspree alternative?
Web3Forms allows 250 submissions a month free, Forminit (formerly Getform) 100 with file uploads, and Basin 50. If your site is on Netlify, Netlify Forms is free and unlimited on its credit-based plans (all checked October 2026).
Should I use PHP mail() or SMTP?
SMTP through a real mail provider, if you can. mail() only hands the message to the server's local mail program, and PHP's own manual says that being accepted for delivery doesn't mean it will arrive. SMTP lets you log in to a provider whose domain records are set up properly.
How do I add a CAPTCHA to a PHP contact form?
Add a widget like Cloudflare Turnstile to the form, then check the token on your server by posting it with your secret key to Turnstile's siteverify endpoint before you send anything. Each token is valid for five minutes and can only be checked once.


