Hey,
i've used the mail() function before and it works perfectly but i've just written a new script that involves the mail() function and although it's returning true (ie. was successful) no mail is recieved in the inbox :-S
I'm using:
$username = ($_GET['username']);
$res1 = mysql_query("SELECT email FROM Forum_Users WHERE username='$username'",$connection);
$row = mysql_fetch_assoc($res1);
$email = $row[0];
$currentuser = ($_SESSION['username']);
$to = $email;
$subject = $username." has sent you a message";
$message = ($_POST['usermessage']);
$headers = 'From: [email]blabla@hotmail.co.uk[/email]'."\r\n".'Reply-To: [email]blabla@hotmail.co.uk[/email]'."\r\n".'Content-type: text/html; charset=iso-8859-1'."\r\n";
if (mail($to, $subject, $message, $headers)) {
echo "Your message has been sent to $username successfully";
}else{
echo "Error sending mail. ".mysql_error();
}
So if anyone can tell me why this wudnt work, would they mind letting me know please, i just cant figure it out :-S
Thanks, BIOSTALL