Send Email Using PHP

<html>
    <head>
        <title>Email Sending</title>
    </head>
    <body>
       
   <form method="POST">
       <label>Name : </label>
       <input type="text" name="email"><br>
       <label>Email :</label>
       <input type="email" name="email"><br>
       <input type="submit" name="send" value="Send Mail">
   </form>





<?php

                                       
                                        if(isset($_POST['send']))
                                        {
                                            extract($_POST);

                                       
                                       
                                                         $to="$email"; //change to ur mail address
                                                         $strSubject="Vasant Dhatrak. ";
                                                         $message = '<h3>Thank You For Registration.</h3>' ;             
                                                         $headers = 'MIME-Version: 1.0'."\r\n";
                                                         $headers .= 'Content-type: text/html; charset=iso-8859-1'."\r\n";
                                                         $headers .= "From: contact@kaizenedutech.com";           
                                                         $mail_sent=mail($to, $strSubject, $message, $headers); 
                                                          if($mail_sent) echo 1;
                                                          else echo 0; 
                                                    
                                                        echo "<script>";
                                                        echo "alert('Thank You For Registration Please Cheack Your Mail. ');";
                                                        echo "window.location.href='index.php';";
                                                        echo "</script>";                                                                       
                                           

                                        }


                                    ?>
                                   
 </body>
</html>
Previous
Next Post »