nathanmaxsonadil Posted August 18, 2007 Share Posted August 18, 2007 my mailer is not working it does not give me any error and it does not send it is there anyway to debug it? here's my code else { $checklogin2 = "SELECT * FROM users WHERE email = '". $_POST['email']. "'"; $checklogin = mysql_query($checklogin2); while ($row = mysql_fetch_array($checklogin, MYSQL_ASSOC)) { if(mysql_num_rows($checklogin) == 0) { forum("Your email is not registered with us!<br/><br/>"); include 'sidebar.php'; echo $divs; include 'footer.php'; exit(); }else if(mysql_num_rows($checklogin) == 1) { $password = createRandomPassword(); //mailer $to = "{$_POST['email']}"; $subject = 'your new password'; $message = "Your new password at Swap Invites is {$password}"; $headers = 'From: noreply@swapinvites.com' . "\r\n" . 'Reply-To: noreply@swapinvites.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers) or die; //end mailer $password = sha1($password); mysql_query("UPDATE `users` SET `password` = '{$password}' WHERE CONVERT( `users`.`username` USING utf8 ) = '{$row['username']}' LIMIT 1") or die; forum("Your new password should be waiting at your inbox!<br/><br/>"); include 'sidebar.php'; echo $divs; include 'footer.php'; exit(); } } } Quote Link to comment https://forums.phpfreaks.com/topic/65587-mailer-not-working/ Share on other sites More sharing options...
php_tom Posted August 18, 2007 Share Posted August 18, 2007 Some servers (especially free hosting servers) disable mail(). Check your host's service plan for this, usually the tell you somewhere. Quote Link to comment https://forums.phpfreaks.com/topic/65587-mailer-not-working/#findComment-327479 Share on other sites More sharing options...
ILYAS415 Posted August 18, 2007 Share Posted August 18, 2007 replace the $to variable with... $to = "$_POST['email']"; or $to = "".$_POST['email'].""; Quote Link to comment https://forums.phpfreaks.com/topic/65587-mailer-not-working/#findComment-327582 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.