Monday, 7 May 2018

email - sendmail.php not sending textbox data of form

I am trying this sendemail.php script. It is sending mail but it is not sending data entered in the textboxes of the form.



sendemail.php



header('Content-type: application/json');

$status = array(
'type'=>'success',
'message'=>'Email sent! We Will get back to you soon. :)'
);

$name = @trim(stripslashes($_POST['name']));
$email = @trim(stripslashes($_POST['email']));
$subject = @trim(stripslashes($_POST['subject']));
$message = @trim(stripslashes($_POST['message']));
// $name = $_POST['name'];

// $email = $_POST['email'];
// $subject = $_POST['subject'];
// $message = $_POST['message'];

$email_from = $email;
$email_to = 'dhaval@geekslabstudios.com' . ' , ' ;
$email_to .='kamal@geekslabstudios.com';

$body = 'Name: ' . $name . "\n\n" . 'Email: ' . $email . "\n\n" . 'Subject: ' . $subject . "\n\n" . 'Message: ' . $message;


$success = @mail($email_to, $subject, $body, 'From: <'.$email_from.'>');

echo json_encode($status);
die;
?>


index.html form





























It sends mail but i receives like this:



Name:



Email:



Subject:




Message:

No comments:

Post a Comment

casting - Why wasn&#39;t Tobey Maguire in The Amazing Spider-Man? - Movies &amp; TV

In the Spider-Man franchise, Tobey Maguire is an outstanding performer as a Spider-Man and also reprised his role in the sequels Spider-Man...