Thursday 3 March 2011

send message in php

<?php
$to="test.org";//here type email address for sending email
$subject=$_REQUEST['subject'];//subject
$content= <<< MSG

<html><body>
<table  width="800" align="center"  border="1" cellpadding="2" cellspacing="2">

    <tr><td width="144">Name</td> <td width="636">{$_POST['name']} </td> </tr>//fields you want to sent to client
   <tr><td>Email</td><td>{$_POST['email']} </td></tr>//fields you want to sent to client
    <tr><td>Contact</td><td>{$_POST['phoneno']} </td></tr>//fields you want to sent to client
    <tr><td>Message</td><td>{$_POST['message']} </td></tr>//fields you want to sent to client
   
   
   
</table></body></html>
MSG;
mail($to,$subject,$content,"Content-type: text/html");
    echo <<< GREET

GREET;

print("<script>window.location-'mail.php'</script>");//redirect page as a clientsite

?>