

Responsive Contact Form with Google reCAPTCHA Responsive Contact Form with Google reCAPTCHA
Lightweight mobile-ready PHP contact form with Google reCAPTCHA v3, SMTP mailer, easy config and no external libraries.
Responsive Contact Form with Google reCAPTCHA
Lightweight mobile-ready PHP contact form with Google reCAPTCHA v3, SMTP mailer, easy config and ...
Overview
Responsive Contact Form with Google reCAPTCHA + SMTP Mailer
Create secure, professional contact forms in minutes.Â
This lightweight PHP script features Google reCAPTCHA v3 integration, built-in SMTP mail sending, spam protection, and no external libraries needed.Â
Fully responsive and mobile-ready, it's perfect for modern websites that need reliable contact functionality with minimal setup.Â
Includes JavaScript and PHP validation, honeypot security, and user confirmation emails - all in one clean, customizable package.
🚀 How It Works
- ➤ User fills out the form and submits
- ➤ Client-side JavaScript validates inputs
- ➤ Google reCAPTCHA is verified
- ➤ Honeypot spam trap is checked
- ➤ Admin receives an email
- ➤ User receives a confirmation email
Features
✨ Features
- ✅ Fully responsive layout.
Designed to work seamlessly on all screen sizes—desktops, tablets, and mobile devices. - ✅ Google reCAPTCHA v3 integration.
Helps protect your form from bots and spam without user interaction, using invisible background validation. - ✅ Honeypot spam protection.
A simple but effective hidden field technique that blocks most automated spam bots. - ✅ JavaScript + PHP validation.
Ensures that the form is validated both on the client side (for UX) and server side (for security). - ✅ Built-in SMTP mailer using.
Sends messages securely via any SMTP server without relying on third-party libraries. - ✅ Confirmation email to the user.
Automatically sends a confirmation message to users, enhancing trust and communication. - ✅ No PHPMailer or external libraries needed.
Lightweight and dependency-free, making it easy to maintain and deploy.
Requirements
🔧 Requirements
- PHP 7.2+ runtime.
- OpenSSL extension enabled.
fsockopen()
must be enabled on your server. (contact us for additional server support).- A valid SMTP account. (e.g., Gmail, Outlook, Zoho, etc).
Instructions
💻 Installation
- ➤ Upload the files to your PHP web server
- ✎ Open
send.php
and edit the configuration section:
// === CONFIGURATION === $admin_email = '[email protected]'; $from_email = '[email protected]'; $from_name_prefix = 'Your Site Name'; // reCAPTCHA keys (get from https://www.google.com/recaptcha/admin) $recaptcha_sitekey = 'your-site-key'; $recaptcha_secret = 'your-secret-key'; // SMTP credentials $smtp_host = 'smtp.yourhost.com'; $smtp_port = 587; $smtp_user = '[email protected]'; $smtp_pass = 'your-smtp-password'; // === END CONFIGURATION ===
- ✎ Edit
index.php
and update this button to use your site key:
<button class="g-recaptcha" data-sitekey="your-site-key" data-callback="onSubmit" data-action="submit"> Send Message </button>
Category | Scripts & Code / PHP Scripts / Forms |
First release | 15 May 2025 |
Last update | 15 May 2025 |
Files included | .php, .css, .html, Javascript .js |
Tags | responsive, contact form, Clean Design, lightweight, javascript validation, mobile-ready, easy setup, anti-spam, spam filter, smtp mailer, recaptcha v3, honeypot, php validation, email confirmation, bot protection |