Hi,
I tried using simple php mail Its working successfully for me.
Now , i tried to send the form and its contents through mail.
I have a php form (form1.php) and if i submit the form, it opens the form2.php showing the output of form1.php.
form2.php i have a submit button, if hit the submit the form details along with form should be emailed and redirect to someotherform.php.
I tried using
<?PHP
$subject = "Testing to send form with contents";
$from = "no-reply@domain.com";
$headers = "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\n";
$headers .= "From:$from";
//open buffer
ob_start();
//send page content to buffer
require("form2.php");
$to = "myemail@domain.com";
//get contents from buffer
$message =ob_get_contents();
mail($to, $subject, $message, $headers);
header("location:someotherform.php");
//close buffer, leave content to display on next page
ob_end_flush();
?>
I could able to get only the empty form(form2.php) but not its contents.
I am not storing the data entered by user in form2.php.
Is it possible to send the form without storing its value in table?
How can i do this? Please help.
Thanks.