简体   繁体   中英

my php mail function is not sending delevering mails in yahoo

This is the way i used the mail function in php. Everything is fine for gmail; it is delivering in inbox, but in yahoo it is not delivering.

if (isset($_POST['send'])) 

    {

                   $uname=$_POST['username'];
        $mailid=$_POST['mail'];
        $subject="hai";
        $mail="myyahooid@yahoo.com";
        $sendmessage=$_POST['sendmessage'];
        $headers= "From:".$mailid."\n";
        $headers .= 'MIME-Version: 1.0′ . PHP_EOL';
        $headers .= 'Content-type: text/html; charset=iso-8859-1'. PHP_EOL;
        $mail_sent=mail($mail, $subject, $sendmessage,$headers);
        if($mail_sent)
        echo "Thanks ";
        else
        echo "Request unsuccessful";


}

I don't know where the problem is. When I sent it to yahoo it is giving me the success message but not delivering.

Apart from my comments for message filtering settings -

Change -

$headers .= 'MIME-Version: 1.0′ . PHP_EOL';

To

$headers .= 'MIME-Version: 1.0'.PHP_EOL;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM