I have php code intended to send email from my website. However the email I got from my website is not complete{"phone,subject etc are missing"}. I can only see sender email and message they send.
I tried to fix the problem as i'm new to php i can't figure it out what is causing this problem.
$product = $_POST["product"];
$name = $_POST["name"];
$email= $_POST["email"];
$phone= $_POST["phone"];
$subject= $_POST["subject"];
$message= $_POST["message"];
$emailSubject="Emaill Subject" .$subject;
$txt = "You have recived Inquiry from:$name.\n".
"Product: $product.\n".
"Product: $product.\n".
"Phone: $phone".
"Message: $message.\n";
$to = 'info@badestrading.com';
$headers = "Mail From: $email \r\n" ; // Sender's E-mail
mail($to, $subject, $txt, $headers);
if (@mail($to, $subject, $txt, $headers))
{
echo 'The message has been sent.';
}else{
echo 'failed';
}
Email: xyz@gmail.com phone: Text: Testing contact form
This is the email I got.