Submitting Html5 Forms To Email (via Php?)
Solution 1:
add a method to your form as:
<form action="" method="post" id="vendorInfo"> //its an example
Give name attribute to your all input filed as:
<input type="text" name="whatever"> //its an example
then catch these by post method in php
<?phpif(isset($_POST['your_submit_name']))
{
$input_field=$_POST['your_input_field_name'];
$to = "somebody@example.com";
$subject = "your subject";
$message= "Hello mail!". "\r\n";
$message.= $input_field."\r\n";
$headers = "From: webmaster@example.com" . "\r\n" ;
mail($to,$subject,$message,$headers);
?>
Solution 2:
You would need to submit the form to a mailer script on your server (mail.php). Once the server has the form information you can start building the message body there and use the php mail() function to send the message.
To learn about sending mail via php i suggest reading the php docs here: http://www.php.net/manual/en/function.mail.php
You can also format the body of your message with html to have it render nicely in an email client.
You may have to research how to enable send mail via whatever server you'er using. I think by default it is disabled.
Post a Comment for "Submitting Html5 Forms To Email (via Php?)"