File manager - Edit - /home/asiatechinc/public_html/asiatech-websites/rococopelton.com/mail.php
Back
<?php if ($_SERVER["REQUEST_METHOD"] == "POST") { $name = $_POST["name"]; $email = $_POST["email"]; $phone = $_POST["phone"]; $message = $_POST["message"]; $captcha = $_POST['g-recaptcha-response']; $secretKey =""; $response = file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=$secretKey&response=$captcha"); $responseData = json_decode($response); if ($responseData->success) { $EmailTo = "rococo.pelton@gmail.com"; $Subject = "Query From Rococo Pelton Beach Resort"; // prepare email body text $Fields .= "<table border='2px' style='border-collapse:collapse; width:100%;'>"; $Fields .= "<tr>"; $Fields .= "<td style='padding:5px;'>Name</td>"; $Fields .= "<td style='padding:5px;'>".$name."</td>"; $Fields .= "</tr>"; $Fields .= "<tr>"; $Fields.= "<td style='padding:5px;'>Email</td>"; $Fields .= "<td style='padding:5px;'>".$email."</td>"; $Fields .= "</tr>"; $Fields .= "<tr>"; $Fields.= "<td style='padding:5px;'>Phone</td>"; $Fields .= "<td style='padding:5px;'>".$phone."</td>"; $Fields .= "</tr>"; $Fields .= "<tr>"; $Fields .= "<td style='padding:5px;'>Message</td>"; $Fields .= "<td style='padding:5px;'>".$message."</td>"; $Fields .= "</tr>"; $Fields .= "</table>"; // // send email $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n"; $headers .= 'From: '.$email. "\r\n"; $success = mail($EmailTo, $Subject, $Fields, $headers); header("Location:thank-you.php"); } else { header("Location: ".$_SERVER['HTTP_REFERER']."?error=captcha"); exit; } } ?>
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings