I am trying to send an email to users, if they have forgotten their password. I have editied the php.ini file to have:
[mail function]
; For Win32 only.
SMTP = smtp.freeserve.com ; for Win32 only
; For Win32 only.
sendmail_from = me@hotmail.com ; for Win32 only
I have also created a script where i ask the user who has forgotten these details to enter their email address in. Once entered and submitted, i have tried to send the user their details but keep getting error saying
Warning: mail(): "sendmail_from" not set in php.ini or custom "From:" header missing in C:\Program Files\Apache Group\Apache2\htdocs\forgotid.php on line 25
Failure
my coding is:
$email=$HTTP_POST_VARS['email'];
$username=$HTTP_GET_VARS['username'];
$password=$HTTP_GET_VARS['pwd1'];
if (!$email) {
echo"Please enter an email address or go back to <a href=\"login.html\"> login";
}
$user="me";
$database="registration";
mysql_connect("localhost",$user);
mysql_select_db($database) or die( "Unable to select database");
$sql= mysql_query( "select * from reg where email='$email'");
$recipient = "$email";
$subject = "Your subject line goes here";
$mailheader = "From: me@hotmail.com\n";
$mailheader .= "Need more help? Email: me@hotmail.com\n\n";
$message = "Sender's name: Me\n";
$message .= "Users's ID: $username\n\n";
mail($recipient, $subject, $message, $mailheader) or die ("Failure");
Can anyone see where i am going wrong.
Thanks