Simple form using Ajax, validations, SMTP and reCAPTCHA v3 for PHP.
You can try this: https://dev.raspgot.fr/github/contact-form-recaptcha-v3
- Ajax submission
- SMTP Authentication
- Google reCAPTCHA v3
- Validation and inputs security (PHP and JS)
Use clone command or direct download
git clone https://github.com/raspgot/AjaxForm-PHPMailer-reCAPTCHA.git
cd AjaxForm-PHPMailer-reCAPTCHA
php -S localhost:8000
Or use XAMMP
SMTP sender → HERE
GOOGLE keys → HERE
More configuration example → HERE
AjaxForm.php
Timezones doc → HERE
date_default_timezone_set('America/Los_Angeles');
const HOST = 'mail.infomaniak.com'; #SMTP server
const USERNAME = ''; #SMTP username
const PASSWORD = ''; #SMTP password
const SECRET_KEY = ''; #GOOGLE secret key
AjaxForm.js
const publicKey = ''; // GOOGLE public key
index.html
<script src="https://www.google.com/recaptcha/api.js?render=GOOGLE_PUBLIC_KEY"></script>
You can visit my Portfolio and star this repo if you like it 🤖