Wednesday, March 26, 2014

PHP Email script

<?php

$to= "test@gmail.com"; /*To Mail*/
$subject = 'Contact us'; /*Subject*/
$header = "From: test@gmail.com \r\n"; /*From mail*/
$header.= "MIME-Version: 1.0\r\n";
$header.= 'X-Mailer: PHP/'.phpversion();
$header .= "X-Priority: 1";
$header.= "Content-Type: text/html; charset=ISO-8859-1\r\n";/*Mail format .You can change this(text/plain) if you didnt use html codes*/
$message = 'Test for mail script'; /*Your Message*/

$flgSend=mail($to,$subject,$message,$header);
    if($flgSend)
    {
        echo "Thank you! Successfully submitted";
               
    }
    else
    {
         echo "OOPS.Please try again";
               
    }
?>

No comments:

Post a Comment