简体   繁体   English

PHP 5.4.30 mail()函数为Gmail / yahoo电子邮件ID提供服务器未找到错误

[英]PHP 5.4.30 mail() function gives Server Not Found Error for Gmail/yahoo Email id

I have upgrade my server php version to 5.4.30 我已经将服务器php版本升级到5.4.30

When I use mail() with this version it send mails to other mail id like my company's webmail but when i use Gmail/yahoo Email it fails to send Email and gives 500 Internal Server Error 当我在此版本中使用mail()时 ,它会将邮件发送到其他邮件ID,例如我公司的网络邮件,但是当我使用Gmail / yahoo电子邮件时,它无法发送电子邮件并给出500 Internal Server Error

Code : 代码

<?php
$arr = array('myemail@company.com','myemail@gmail.com');
foreach($arr AS $key => $value)
{
    $to = $value;
    $subject = "Test Mail";
    $message = "<p>TEST</p>";

    $from = "senderemail@gmail.com";    
    $headers  = "MIME-Version: 1.0\r\n";
    $headers .= "Content-type: text/html; charset=UTF-8\r\n";
    $headers .= "From: <".$from.">" ;
    mail($to, $subject, $message, $headers);
    //  It send mail to myemail@company.com this id
    // but for gmail id it shows error
}
?>

我从服务器端更改了一些设置。.i将我的站点ip添加到连接器的服务器设置中,它再次像魅力一样工作并保存了我的头发。

<?php
ob_start();
$arr = array('myemail@company.com','myemail@gmail.com');
foreach($arr AS $key => $value)
{
    $to = $value;
    $subject = "Test Mail";
    $message = "<p>TEST</p>";

    $from = "senderemail@gmail.com";    
    $headers  = "MIME-Version: 1.0\r\n";
    $headers .= "Content-type: text/html; charset=UTF-8\r\n";
    $headers .= "From: <".$from.">" ;
    mail($to, $subject, $message, $headers);
    ob_flush();
}
ob_end_flush();
?>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用php mail()函数的电子邮件附件-适用于gmail,但不适用于yahoo - Email Attachments using php mail() function - Working for gmail but not working for yahoo 使用此PHP邮件功能时,为什么我的gmail或yahoo电子邮件帐户没有收到邮件 - Why isn't my gmail or yahoo email accounts receiving mail when I use this PHP mail function 使用php mail()函数的电子邮件附件-适用于gmail,但对于yahoo,附件的大小为空(0字节) - Email Attachments using php mail() function - Working for gmail but attachments are of null size (0 bytes) for yahoo 如果发件人是Yahoo邮件,则Gmail不会收到phpmailer电子邮件 - phpmailer email not received by gmail if sender is yahoo mail PHP邮件功能无法向Gmail帐户发送电子邮件? - PHP mail function not sending email to Gmail account? 奇怪的回调错误PHP 5.4.30 - Strange Callback Error PHP 5.4.30 当发件人地址为yahoo时,php邮件功能不发送电子邮件 - php mail function not sending email when From address is yahoo 用于Outlook的php邮件标题 - 电子邮件到达Outlook是空的,并且对于雅虎来说很棒 - php mail headers for outlook - the email arrives empty to outlook, and great to gmail to yahoo 通过PHP邮件功能未在Gmail电子邮件ID上收到的邮件:saett.mishra@atlascorps.org - Mails not received on Gmail Email ID: saket.mishra@atlascorps.org through PHP Mail Function 邮件功能不适用于Yahoo邮件ID - mail function not working for yahoo mail id
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM