File manager - Edit - /home/asiatechinc/public_html/asiatechinc-websites/lehlingguesthouse.com/include/mailer.php
Back
<?php // Only process POST reqeusts. if (isset($_POST)) { // Get the form fields and remove whitespace. $name = strip_tags(trim($_POST["name"])); $name = str_replace(array("\r","\n"),array(" "," "),$name); $email = filter_var(trim($_POST["email"]), FILTER_SANITIZE_EMAIL); $contact = strip_tags(trim($_POST["contact"])); $message = strip_tags(trim($_POST["message"])); if ( empty($name) OR !filter_var($email, FILTER_VALIDATE_EMAIL) OR $contact =='' ) { echo "Oops! There was a problem with your submission. Please complete the form and try again."; exit; } $subject="Enquiry Mail"; // Set the email subject. $subject = " $subject"; $message1="<table><tr><td>Name</td><td>".$name."</td></tr> <tr><td>Email</td><td>".$email."</td></tr> <tr><td>Contact</td><td>". $contact."</td></tr> <tr><td>Message</td><td>". $message."</td></tr> </table>"; $recipient = "lehling2007@rediffmail.com "; // $email_content .= "Name: $name\n"; // $email_content .= "Email: $email\n"; // $email_content .= "Message:\n$message\n\n"; // Build the email headers. $email_headers = "From: $name <$email>"; $email_headers .= "Reply-To: $email \r\n"; $email_headers .= "Content-Type: text/html; charset=utf-8"; // Send the email. if (mail($recipient, $subject,$message1, $email_headers)) { // Set a 200 (okay) response code. echo "Thank You! Your message has been sent."; } else { // Set a 500 (internal server error) response code. echo "Oops! Something went wrong and we couldn't send your message."; } } else { // Not a POST request, set a 403 (forbidden) response code. echo "There was a problem with your submission, please try again."; } ?>
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings