Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
494 B
0
Indexable
Never
<?php
$to_email = 'abduurrab0408@gmail.com';
$subject = 'New feedback from website';
$name = $_POST['name'];
$email = $_POST['email'];
$subject = $_POST['subject'];
$message = $_POST['message'];
$body = "Name: $name\nEmail: $email\nSubject: $subject\nMessage: $message";
$headers = "From: $email";

if (mail($to_email, $subject, $body, $headers)) {
  echo 'Thank you for your feedback!';
} else {
  echo 'There was an error sending your feedback. Please try again later.';
}
?>