HTML contact form via PHPMailer, using Gmail account.
- PHPMailer
- Gmail account credentials
- Check on GitHub repo https://github.com/PHPMailer/PHPMailer to download and install PHPMailer
- In mail.php file configure PHPMailer, indicating your email address and SMTP password, provided by Gmail account
$mail->isSMTP(); //Send using SMTP
$mail->Host = 'smtp.gmail.com'; //Set the SMTP server to send through
$mail->SMTPAuth = true; //Enable SMTP authentication
$mail->Username = '###############@gmail.com'; //SMTP write your email
$mail->Password = '#################'; //SMTP password
$mail->SMTPSecure = 'ssl'; //Enable implicit SSL encryption
$mail->Port = 465;
$mail->addAddress('##############@gmail.com'); //Add a recipient email
- Run contact form.html and visit your local host
My personal working contact form can be checked here
![contact form](https://private-user-images.githubusercontent.com/67701977/300781456-c1cacd04-f6f2-40df-9dfa-f1a0fa98fb65.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU3MzMxMDIsIm5iZiI6MTcyNTczMjgwMiwicGF0aCI6Ii82NzcwMTk3Ny8zMDA3ODE0NTYtYzFjYWNkMDQtZjZmMi00MGRmLTlkZmEtZjFhMGZhOThmYjY1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTA3VDE4MTMyMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTRiYTZiNDNlMDY1YThkZGI3MDA5ZTViMWJkZTNhNTkyNTJkMzMwYTI2OTU3Mzg0YTE0NWFkMzdiYzNjYmRhYmQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.2f2OEYwZptXSYYQPczblulJB3EJVTn6SNXKr6vIjric)
![email](https://private-user-images.githubusercontent.com/67701977/300781585-865eaa0f-3360-4439-8ec3-7f51d0ce8371.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU3MzMxMDIsIm5iZiI6MTcyNTczMjgwMiwicGF0aCI6Ii82NzcwMTk3Ny8zMDA3ODE1ODUtODY1ZWFhMGYtMzM2MC00NDM5LThlYzMtN2Y1MWQwY2U4MzcxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTA3VDE4MTMyMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTcwMGMxOWQwZTA1YzczOGNmMGNjNjQ5ZDc0MmRlODg0YjA3NGY3NDViMjA3MTYwZTgyMGRiYzhlMGZiNWQzMzUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.9agfb99m2WH8QR-uJZaaDy4aJelwjY8yYv9VF0RYwfM)