I have a webiste and would like to send an email to someone, and myself, when they request their lost password. For some reason, I can't get the mail() function to work, no matter what I do. I unsuccessfully tried to model it after the listserv I created and am at a loss. Please help if you can.
<!DOCTYPE html> <title></title> <head></head> <body> <?php require_once('connect.php'); $user=mysql_real_escape_string($_REQUEST['lin']); $subject='Rounsworld lost information'; $from='Password retrieval at rounsworld.com'; $headers="From:" . $from; $result=mysql_query("SELECT login,password FROM demo WHERE Name='$user'") or die(mysql_error()); $mresult=mysql_query("SELECT email FROM maillist WHERE name='$user'") or die(mysql_error()); $row=mysql_fetch_array($result); $mrow=mysql_fetch_array($mresult); $message= 'Your login id is ' . $row['login'] . '<br>' . 'Your password is ' . $row['password']; mail('email@example.com',$subject,$headers,$message); mail($mrow['email'],$subject,$headers,$message); echo 'Your request has been sent to the email address on file. If you do not receive an email, please let me know <br>'; ?> </body> </html>