Jump to content

Recommended Posts

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...

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/159920-help-with-php-mail/
Share on other sites

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?

Link to comment
https://forums.phpfreaks.com/topic/159920-help-with-php-mail/#findComment-844231
Share on other sites

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

Link to comment
https://forums.phpfreaks.com/topic/159920-help-with-php-mail/#findComment-844256
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.