🎥 PodcastsDesigned in California Makes Its Official Debut(03.09.2026 um 17:59 Uhr)
🔧 AI Nachrichten Major AI platforms go down in unprecedented simultaneous outage(03.09.2026 um 17:34 Uhr)
🍏 iOS / Mac OSWill Siri AI Speak Hindi? What Apple Has Published for India(11.09.2026 um 05:15 Uhr)
🍏 iOS / Mac OSiPhone Duo Apps Could Make or Break Apple’s Foldable iPhone(11.09.2026 um 05:16 Uhr)
🎥 PodcastsDesigned in California Makes Its Official Debut(03.09.2026 um 17:59 Uhr)
🔧 AI Nachrichten Major AI platforms go down in unprecedented simultaneous outage(03.09.2026 um 17:34 Uhr)
🍏 iOS / Mac OSWill Siri AI Speak Hindi? What Apple Has Published for India(11.09.2026 um 05:15 Uhr)
🍏 iOS / Mac OSiPhone Duo Apps Could Make or Break Apple’s Foldable iPhone(11.09.2026 um 05:16 Uhr)

🔧 Programmierung 🕛 vor 3 Monaten 3 Min Lesezeit
0

Build a $0/month contact form backend with Google Sheets

↗ Quelle (dev.to)
🗣️ Stimme:
📑 Inhaltsübersicht

Static sites do not need a monthly form backend.



If you build portfolio sites, landing pages, or simple client websites, the contact form is usually the awkward bit. You do not want to run a server just to collect a name, email, and message. But many hosted form services charge $10-20/month once you want Google Sheets, notifications, or no branding.



A small Google Apps Script can do the same job for free.






The architecture



The flow is simple:




CODE
HTML form -> Google Apps Script doPost -> Google Sheet
-> email notification
-> optional auto-reply






Your form sends a POST request to a Google Apps Script web app. The script validates the submission, filters obvious spam, writes a row to Google Sheets, and sends an email notification with MailApp.sendEmail().



No server. No database. No SMTP provider. No monthly invoice.






Core handler



The endpoint is a doPost function:




CODE
function doPost(e) {
try {
return handlePost(e);
} catch (err) {
console.error(err);
return jsonResponse('error', 'Internal server error.');
}
}






Inside handlePost, the useful pipeline is:




  1. Parse JSON or form-urlencoded input.

  2. Check a honeypot field.

  3. Validate required fields.

  4. Reject malformed email addresses.

  5. Apply simple keyword spam filtering.

  6. Rate limit repeated submissions.

  7. Append a row to Google Sheets.

  8. Send the owner an email notification.

  9. Optionally send an auto-reply.



A honeypot field is especially useful. Bots often fill every field they see. Humans never fill a hidden _gotcha field. If that field has a value, return a fake success and do not write to the sheet.






Google Sheets as the database



For a contact form, Google Sheets is a perfectly reasonable database. It is searchable, exportable, and easy for non-technical clients to understand.




CODE
function ensureSheet(sheetName) {
const ss = SpreadsheetApp.getActiveSpreadsheet();
let sheet = ss.getSheetByName(sheetName);

if (!sheet) {
sheet = ss.insertSheet(sheetName);
sheet.appendRow(['Timestamp', 'Name', 'Email', 'Message', 'Source URL']);
sheet.setFrozenRows(1);
sheet.getRange('D:D').setWrap(true);
}
}






Then append the submission:




CODE
function appendRow(sheetName, row) {
SpreadsheetApp.getActiveSpreadsheet()
.getSheetByName(sheetName)
.appendRow(row);
}









Email notifications without SMTP



Apps Script includes MailApp.sendEmail(), so the script can notify the site owner without SendGrid, Mailgun, or SMTP setup.




CODE
MailApp.sendEmail({
to: cfg.recipientEmail,
subject: 'New Contact Form Submission',
body: `${name} <${email}> sent:\n\n${message}`
});






That is enough for many client sites.






HTML integration



Your frontend only needs a normal submit handler:




CODE
const res = await fetch(SCRIPT_URL, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
name: form.name.value,
email: form.email.value,
message: form.message.value,
_gotcha: form._gotcha.value
})
});

const json = await res.json();






Deploy the Apps Script as a web app, set access to "Anyone", copy the deployment URL, and paste it into your form JavaScript.






When this is a good fit



This pattern works well for:




  • portfolio contact forms

  • agency landing pages

  • small business websites

  • waitlists

  • internal request forms

  • low-volume lead capture



It is not the right tool for file uploads, payment forms, or very high-volume transactional workloads.






Source code



I published a complete MIT-licensed implementation here:



https://github.com/ttcd77/form-handler



It includes Google Sheets storage, email notifications, honeypot spam protection, keyword filtering, rate limiting, auto-replies, and an example HTML form.



The project also has a one-time paid version for teams that want setup UI and multi-form quality-of-life features, but the open-source script is fully usable on its own.



Disclosure: this article was drafted with AI assistance and manually checked before posting.

Vollständiger Original-Bericht
Ausführliche Details, Code-Beispiele & Hersteller-Stellungnahme auf dev.to.
↗ Original-Artikel auf dev.to lesen
Wie bewertest du diesen Beitrag?
1 Klick Feedback
Teilen mit Netzwerk & Team:

Community-Analysen & Experten-Meinungen 0

Verfasse deine eigene Analyse, teile Workarounds oder diskutiere diesen Vorfall im Blog.
Noch keine Community-Analyse verfasst. Markiere einen Textabschnitt oder klicke oben auf Eigene Analyse verfassen“!
Community Pulse: Relevanz-Einschätzung
1 Klick Experten-Votum
🔴 Akute Relevanz 0%
🟡 In Evaluierung 0%
🟢 Keine Auswirkung 0%
Spannende Innovation 0%
Verwandte Story-Cluster & Quellen (Vektor-KI)
Port 8095 Engine
1 Quelle
Samsung Taps Mistral AI for On-Premises Chip Manufacturing
1 Quelle
CISA’s ChatGPT Incident Exposes a Bigger AI Governance Problem
1 Quelle
Beware — these new phishing attacks use a convincing fake Adobe Reader pages to trick victims into installing malware
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Build a $0/month contact form backend with Google Sheets

Thematisch verwandte Begriffe: Build, 0month, contact, form · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...