Friday, 14 February 2014

Mail Function

index.php




$mymail='vintechnosys@gmail.com';
sendmailtoclient($email,$mymail);
sendmailtoadmin($mymail,$email,$name,$subject,$message);


_________________________________________________________________________



function.php


<?php

function sendmailtoclient($toclient,$fromadmin)
{
$client=$toclient;
$subject="WELCOME TO VIN Technosys";
$message="Your enquiry has been received by us...We will contact you shortly<br>THANK YOU.";
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";
$headers .= 'From: <'.$fromadmin.'>' . "\r\n";
mail($client,$subject,$message,$headers);
echo"MESSAGE SENT";
}
function sendmailtoadmin($toadmin,$fromclient,$nam,$sub,$msg)
{

$toadmin=$toadmin;
$subject=$sub;
$message="ONE USER (".$nam.") with mailid(".$fromclient.") has enquired you as (".$msg.")";
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";
$headers .= 'From: <'.$fromclient.'>' . "\r\n";
mail($toadmin,$subject,$message,$headers);

}

?>

No comments:

Post a Comment