File manager - Edit - /home/asiatechinc/public_html/asiatech-websites/themountainbreeze.in/mail-onload.php
Back
<?php // reCAPTCHA secret key from Google admin panel $secretKey = "6Lc1QGcrAAAAABqh7lemPng2aCNI89rLI0qGqizF"; // Verify CAPTCHA if (isset($_POST['g-recaptcha-response'])) { $recaptcha = $_POST['g-recaptcha-response']; $response = file_get_contents( "https://www.google.com/recaptcha/api/siteverify?secret=" . $secretKey . "&response=" . $recaptcha ); $responseKeys = json_decode($response, true); if (!$responseKeys["success"]) { echo "CAPTCHA verification failed. Please try again."; exit; } } else { echo "Please complete the CAPTCHA."; exit; } // Sanitize input function clean($value) { return htmlspecialchars(trim($value)); } $name = clean($_POST["name"]); $email = clean($_POST["email"]); $phone = clean($_POST["phone"]); $contact_mode = clean($_POST["contact_mode"]); $planning_time = clean($_POST["planning_time"]); $phone = clean($_POST["phone"]); $message = clean($_POST["message"]); // Email content $EmailTo = "mountainbreezeh@gmail.com, themountainbreezehomestay@gmail.com"; // Replace with your email $Subject = "Enquiry from Mountain Breeze Homestay: " . $subject; $Fields = "<table border='1' cellspacing='0' cellpadding='8' style='border-collapse: collapse;'>"; $Fields .= "<tr><td><strong>Name</strong></td><td>{$name}</td></tr>"; $Fields .= "<tr><td><strong>Email</strong></td><td>{$email}</td></tr>"; $Fields .= "<tr><td><strong>Phone</strong></td><td>{$phone}</td></tr>"; $Fields .= "<tr><td><strong>Contact Mode</strong></td><td>{$contact_mode}</td></tr>"; $Fields .= "<tr><td><strong>Timeframe</strong></td><td>{$planning_time}</td></tr>"; $Fields .= "<tr><td><strong>Message</strong></td><td>{$message}</td></tr>"; $Fields .= "</table>"; // Headers $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=UTF-8\r\n"; $headers .= "From: {$email}\r\n"; // Send email $success = mail($EmailTo, $Subject, $Fields, $headers); // Redirect or show message if ($success) { header("Location: thank-you.php"); exit; } else { echo "Something went wrong. Please try again."; } ?>
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings