rohithreddyk Posted May 27, 2009 Share Posted May 27, 2009 Hi...i am using this code to send mail to the user when he forgets his password and enters his email id and clicks "send password" button... $recipient=$emailid; $subject="Password for ****"; $message="password for given userid is ".$password; $headers = "From: krohitreddy@gmail.com>\r\n"; $headers .= "Reply-To: krohitreddy@gmail.com\r\n"; $headers .= "Return-Path: krohitreddy@gmail.com\r\n"; $headers .= 'MIME-Version: 1.0' . "\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; if(mail($recipient, $subject, $message, $headers)) header("Location:login.php?msg='Your username/password is mailed to your id'"); else echo "mail cannot be send this time"; $emailid , $password are obtained from database. Strangely when i have $emailid as some gmail or yahoo mail id it works just fine.. I receive mail with the password.. but when I have $emailid as my university mail id (******@uh.edu & also *****@central.uh.edu) or my department email id (*****@mail.cs.uh.edu) I am not receiving any mail or the error message either. the "if" conditions is becoming true and I am being redirected to login page... Quote Link to comment https://forums.phpfreaks.com/topic/159920-help-with-php-mail/ Share on other sites More sharing options...
JonnoTheDev Posted May 28, 2009 Share Posted May 28, 2009 This has noting to do with the script. Your university mail servers will be blocking the message. You may need reverse DNS setup on your web server. Quote Link to comment https://forums.phpfreaks.com/topic/159920-help-with-php-mail/#findComment-843964 Share on other sites More sharing options...
rohithreddyk Posted May 28, 2009 Author Share Posted May 28, 2009 Thanks Neil...Can you help with these questions please? 1).why does the university blocks these messages that were perfectly accepted by google n yahoo? 2).is there anyway I can overcoming this without contacting web server admin... 3).If I have to contact web server admin, what all the information I should provide him to overcome this? Quote Link to comment https://forums.phpfreaks.com/topic/159920-help-with-php-mail/#findComment-844231 Share on other sites More sharing options...
JonnoTheDev Posted May 28, 2009 Share Posted May 28, 2009 One reason maybe, your message headers say the message is from krohitreddy@gmail.com however the domain gmail.com will not resolve back to your servers IP address. This could be seen as mail relayed spam. You should send the messages from an alias of the website domain name. Reverse DNS is setup in the PTR entry of the DNS record for your domain. AOL block messages for the same reason http://postmaster.aol.com/guidelines/standards.html Your university may not accept messages from free email accounts like gmail, etc. This is not uncommon. You need to check your server for any bounced messages to get details on why they did not end up in the correct location. Without this info it is hard to say. The IP address of your server maybe on a mail blacklist. This is not uncommon on shared servers as you never know what other users are doing in terms of sending email. Check your server IP with http://dnsstuff.com Quote Link to comment https://forums.phpfreaks.com/topic/159920-help-with-php-mail/#findComment-844256 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.