Send Email Through PHP
Step I
create a HTML page
- <html>
- <body>
- <form method="post" action="email.php">
- Name <input type="text" name="name"><br>
- Email <input type="text" name="email"><br>
- <input type="submit" >
- </form>
- </body>
- </html>
there the method post send the value of all input box to the PHP page
Html page will be look like this
Step II
Create a PHP page
<?php
//get the value send by Method post through HTML page
$name= $_POST["name"]; //value of textbox named "name"
$from= $_POST["email"]; // value of textbox named "email"
$to="xyz@abc.com"; // destination email ID
$messages="write your message here";
$headers = "From:" . $from;
mail($to,$subject,$messages,$headers);
// //////////////////////////////////////////////////////////////////////////////////////////
// Auto mail Reply ////////// /////// //////////////// / / //
// ////////////////////////////////////////////////////////////////////////////////////////
$reply_msg = "thanx for mailing me";
$reply_header="From:" . $to;
$reply_subject=
" auto reply";$reply_to= $from;
mail( $reply_to , $reply_subject , $reply_msg , $reply_header);
?>

No comments:
Post a Comment