i want to send email after redirecting on a page name email.php or it may be anything.when i redirect on this page amal should be send to user automatically.please send me a code for this please help me .thanks

use php mail script.... its available in php tutorial

Yes... U can send mail to the user by redirecting from one page to another page...

you can directly give the needed values to send mail in the redirected page or pass the values like to, from ,sub, message by the following.. Use redirecting code like this....


and you have to get this at redirected page as


and use this $a and $b in appropriate area in mail() function.. It perfectly works..

hope you can understand.. If any probs, please let me know....

if you are sending it to a user who signed up and his informations are recorded in your databases , then you can get his information by using $_SESSIOM and then you connect to mysql
check this code :

$con = mysql_connect("localhost","username","password");
echo "error connecting to mysql server : ".mysql_error();
$username = $_SESSIO['username'];
$select = mysql_select("database_name");
echo "cant select the database ".mysql_error();
$result = mysql_query("SELECT*FROM table_name WHERE username = '$username'");
echo "cant select your datas from the db , please try again laiter ".mysql_error();
while($row = mysql_fetch_array($result))
$email = $row['email'];
$name = $row['username'];
$message = "Hello".$name."\n how r u , thank you for signing p and opening our page than this messgae is bla bla bla ba bla bla bla bla bla ";
email("$email","subject : to $name","$messsage");
echo "a message has been sent to your email ".$email."please open it and check it now ";
echo "please login";
header("location : login.php");

okay , idont know , as a biginner i think this is gonna work .i am not an expert in php so please if my code has any problem please vorrect mne

Hi Prince... Really i appreciate you a lot.. your code is perfect.. But session variable should be $_SESSION. Anyway, it will work fine...