D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
u166148318
/
domains
/
avrd.org
/
public_html
/
Filename :
send_email.php
back
Copy
<?php if ($_SERVER["REQUEST_METHOD"] == "POST") { $to = "reconciliationpgl@gmail.com"; // my receiving email $name = htmlspecialchars($_POST["name"]); $email = htmlspecialchars($_POST["email"]); $subject = htmlspecialchars($_POST["subject"]); $message = htmlspecialchars($_POST["message"]); $email_subject = "New Message: $subject"; $email_body = "Name: $name\nEmail: $email\n\nMessage:\n$message"; $headers = "From: Website Contact <info@avrd.org>\r\n"; $headers .= "Reply-To: $email\r\n"; $headers .= "Content-Type: text/plain; charset=UTF-8\r\n"; if (mail($to, $email_subject, $email_body, $headers)) { // Redirect after successful send header("Location: index.php?success=1"); exit(); } else { // Redirect with failure notice header("Location: index.php?error=1"); exit(); } } ?>