chronister Posted May 13, 2007 Share Posted May 13, 2007 I searched through PHP Freaks and could not find an answer to this. I know it has been asked numerous times, but I cannot find a solution... so here goes. I can receive mail in my Gmail account but not in yahoo. I am using sendmail on my own server. I thought maybe I am getting thrown in the spam folder, but it is not showing up at all. I *think* I have the headers set up right but I am not positive. Here is my mail code <?php $headers ="MIME-Version: 1.0" . "\r\n"; $header .= "X-Mailer: PHP/" .phpversion() ."\n"; $headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n"; $headers .= "From: NAMEHERE <user@domain.com>"; $address=$email; $subject = 'Subject '; $body=' Body of Email Here'; mail($address , $subject, $body, $headers); ?> I have changed some of the code such as the actual body, the from address and such. Those are set correctly in my real code. Any input as to what may be happening or what the secret is to getting Yahoo to receive mail?? Thanks for the help Quote Link to comment https://forums.phpfreaks.com/topic/51222-sending-mail-to-yahoo/ Share on other sites More sharing options...
chigley Posted May 13, 2007 Share Posted May 13, 2007 What's the difference between the way a different email client receives emails? Can't you just use the mail() function like you would to send any other person an email? Quote Link to comment https://forums.phpfreaks.com/topic/51222-sending-mail-to-yahoo/#findComment-252279 Share on other sites More sharing options...
chronister Posted May 13, 2007 Author Share Posted May 13, 2007 That's what I am saying, the exact same code will relay a message to my gmail account, but not to yahoo. I can fill the form out the exact same way minus the email address and Gmail will accept it but yahoo will not. Quote Link to comment https://forums.phpfreaks.com/topic/51222-sending-mail-to-yahoo/#findComment-252282 Share on other sites More sharing options...
OilSheikh Posted May 13, 2007 Share Posted May 13, 2007 Dude, Can u PM me your php.ini and sendmail.conf files. I could never send anything to my Gmail when I last tried :'( Quote Link to comment https://forums.phpfreaks.com/topic/51222-sending-mail-to-yahoo/#findComment-252285 Share on other sites More sharing options...
OilSheikh Posted May 13, 2007 Share Posted May 13, 2007 One more thing, some Mail servers like Hotmail do not allow SMTP. Check if Yahoo does. Quote Link to comment https://forums.phpfreaks.com/topic/51222-sending-mail-to-yahoo/#findComment-252287 Share on other sites More sharing options...
chronister Posted May 13, 2007 Author Share Posted May 13, 2007 If I am not mistaken, sendmail is not smtp. I may be wrong in this, but I don't think that sendmail uses SMTP. @OilSheikh I have attached my php.ini and sendmail.conf files I did nothing in the sendmail.conf file as it worked right at install. The php.ini line you should be concerned with is the following. ; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). sendmail_path = "/usr/sbin/sendmail -t -i" I have found that a big reason why mail gets dropped is be cause this line is missing in the script. $header .= "X-Mailer: PHP/" .phpversion() ."\n"; [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/51222-sending-mail-to-yahoo/#findComment-252293 Share on other sites More sharing options...
chronister Posted May 14, 2007 Author Share Posted May 14, 2007 *bump* Anyone have any suggestions on this?? Quote Link to comment https://forums.phpfreaks.com/topic/51222-sending-mail-to-yahoo/#findComment-252450 Share on other sites More sharing options...
Nhoj Posted May 14, 2007 Share Posted May 14, 2007 Make sure your server has reverse dns enabled, I had the same problem when sending to AOL clients. Here's my exact mail code and it so far has worked for every type of e-mail account I can find. Providing you have reverse dns enabled. $subject = 'SUBJECT'; $message = 'HTML MESSAGE'; $headers = 'MIME-Version: 1.0'."\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1'."\r\n"; $headers .= 'Return-Path: YOURMAIL@DOMAIN.com'."\r\n"; $headers .= 'From: YOUR NAME <YOURMAIL@DOMAIN.com>'; mail('USERSMAIL', $subject, $message, $headers, "-f YOURMAIL@DOMAIN.com"); Quote Link to comment https://forums.phpfreaks.com/topic/51222-sending-mail-to-yahoo/#findComment-252519 Share on other sites More sharing options...
chronister Posted May 14, 2007 Author Share Posted May 14, 2007 Nhoj, I hate to sound like a dummy, but how would I do that. I am running UBUNTU 6.01. Any suggestions for a noob Linux user? also, can you elaborate on what USERSMAIL is and what the -f YOURDOMAIN.com part are. I hope I am nto being stupid, and the USERSMAIL part just means the recipient email address, but if so feel free to call me names mail('USERSMAIL', $subject, $message, $headers, "-f YOURMAIL@DOMAIN.com"); Quote Link to comment https://forums.phpfreaks.com/topic/51222-sending-mail-to-yahoo/#findComment-252523 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.