Tuesday, 12 July 2016

Email send php code



<?php
        extract($_POST);
    $mail="email@yahoo.co.in";
    $subject="Contact Form Enquiry";
    $body="
     Name :- $name <br/>
        Email :- $email <br/>
        Phone No. :- $phoneno<br/>
        Message :- $message
    ";
    $headers = 'MIME-Version: 1.0' . "\r\n";
    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
   $headers .= "Reply-To: <info@email.in>"."\r\n";
   $headers .= 'Cc: <email@gmail.com>'."\r\n";
  $headers .= 'Bcc: <email@gmail.com>'."\r\n";
    $headers .= 'Bcc: <email@gmail.com>'."\r\n";
 
    $headers .= "X-Mailer: PHP/".phpversion();
    $mail_status=mail($mail,$subject,$body,$headers);
    if($mail_status){ ?>
        <script>
            window.location='../index.html';
        </script>
    <?php
    }
    else{ ?>
        <script>
            alert("Error in Contact Form.");
            window.location='../index.html';
        </script>
    <?php
    }
            ?>

No comments:

Post a Comment