Jump to content

Sending mail to yahoo


chronister

Recommended Posts

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 <[email protected]>";
			$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

Link to comment
https://forums.phpfreaks.com/topic/51222-sending-mail-to-yahoo/
Share on other sites

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]

Link to comment
https://forums.phpfreaks.com/topic/51222-sending-mail-to-yahoo/#findComment-252293
Share on other sites

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: [email protected]'."\r\n";
$headers .= 'From: YOUR NAME <[email protected]>';

mail('USERSMAIL', $subject, $message, $headers, "-f [email protected]");

Link to comment
https://forums.phpfreaks.com/topic/51222-sending-mail-to-yahoo/#findComment-252519
Share on other sites

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 [email protected]");

 

 

Link to comment
https://forums.phpfreaks.com/topic/51222-sending-mail-to-yahoo/#findComment-252523
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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