php - Sending email form -
i have created html form, , part of php script. below.
i need, somehow, send form, using mail function. how do this?
html:
<form id="kontaktform" action="scripts-contactform/recieving.php" method="post"> <div id="kontaktformvenstre"> <div id="inputfields_container"> <div id="inputfield_container"> <input class="inputfield" type="text" name="name" placeholder="dit navn" /> </div> <div id="inputfield_container"> <input class="inputfield" type="text" name="email" placeholder="din e-mail" /> </div> </div> <div id="inputfieldmessage_container"> <textarea class="inputfieldmessage" name="message" placeholder="din besked her" rows="8" cols="20"></textarea> </div> </div> <div id="kontaktformhøjre"> <div id="button"> <input type="submit" name="submit" value="send mail" /> </div> </div> </form>
php:
<?php $name = $_post['name']; $email = $_post['email']; $message = $_post['message']; $from = 'fra:'$email; $to = 'myemail'; $subject = 'hello'; $body = "from: $name\n e-mail: $email\n message:\n $message"; ?>
you can send mail this. use php mail()
function.
<?php if(isset($_post['submit'])){ $name = $_post['name']; $email = $_post['email']; $message = $_post['message']; $from = 'fra:'$email; $to = 'myemail'; $subject = 'hello'; $body = "from: $name\n e-mail: $email\n message:\n $message"; mail($to,$subject,$body,"from:$from"); } ?>
Comments
Post a Comment