<?php
if ($_SERVER['REQUEST_METHOD'] == 'POST'){
$fname = $_POST['fname'];
$lname = $_POST['lname'];
$phone = $_POST['phone'];
$email = $_POST['email'];
$mesaj = $_POST['message'];
$to = "email@me.r";
$subject = "Email from Website ";
$body = 'Nume - '.$fname.'
Prenume - '.$lname.'
Email - '.$email.'
Telefon - '.$phone.'
Mesaj - '.$mesaj;
$headers = "From Contact <$email>";
$headers .= "MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8";
if(mail($to, $subject, $body, $headers)){
echo "
<p class='succes'>Thank you for sending me a message!</p>
<meta http-equiv='refresh' content='3; url=contact-me.php' />";
} else {
echo "<p class='succes'>I am sorry, but there appears to be a problem with the form you submitted.</p>";
}
}
?>
I got this form for my contact page, it works, send the message. But the prblem is how the message it is displayed. I got no break lines inside of.. looks very weird.
Whats wrong in the cod?