Hi,

i am very new to php so please forgive me if i sound stupid.i have a tell friend php code

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>iTell from urQuiz</title>
<style type="text/css">
<!--
.style2 {font-size: 12px}
-->
</style>
</head>
<body>
<form action="<? echo $_POST; ?>" method="post"> Your Name : <br />
<input name="name" type="text"><br />Friend's Email Address : <br />
<input name="email" type="text"><br />
<input name="Send" type="submit" value="Send">
</form>
<?

if (@$_POST=="Send")
{
$name=$_POST;
$email=$_POST;
$subject = $name. " wants you to visit this site, its cool!";
//This is the body section of the email and can be substituted for your message
$message= "Hi, \n\n" .$name. " thinks you might like to visit our website : \n\n http://www.yourdomain.co.uk \n\n\n\n\n\n\n\nNote: This message was not sent unsolicited. It was sent through a form located at http://www.yourdomain.co.uk If you believe this message was received on error, please disregard it.";
$headers = 'From: webmaster@yourdomain.co.uk' . "\r\n" . 'Reply-To: webmaster@yourdomain.co.uk' . "\r\n" . 'X-Mailer: PHP/' . phpversion();
mail($email, $subject, $message, $headers);
echo "You`ve recommended our site to: $email Thanks you";
}
?>
<br />
<br />


</body>

</html>

i am running this code on windows >apache server and php 5.
but i cant seem to get it to work.could anybody please help me out and suggest how i could get this script to work on windows ..do i need to change anything in the code or do i need to download any other software..please help

hi,
the code seems to work as i dont get any errors but i do not get any emails after running the code

Umm..sometimes mails sent by php is considered as spam(because of the unknown domain). If that isn't the problem, check your smtp and smtp_port in php.ini.

This article has been dead for over six months. Start a new discussion instead.