PHP发送的邮件不适用于YOPmail

时间:2015-04-15 10:36:21

标签: php email html-email

我正在研究邮件功能,我使用php mail()函数向不同的用户发送邮件。但是,我在我的Gmail和雅虎帐户上收到邮件,但不在我的YOPmail帐户中。有没有人知道YOPmail的邮件问题?解决方案是什么?

这是我的邮件代码:

    $to = 'testuser@yopmail.com';
    $from = 'admin@admin.com';
    $message = 'Test';
    $headers  = "From: $from\r\n"; 
    $headers .= "MIME-version: 1.0\n";
    $headers .= "Content-type: text/html; charset=UTF-8\n";
    $send_mail = mail($to, "Testing Mail", $message, $headers);
    if($send_mail){
        echo "success";
    }
    else{
        echo "fail";
    }

1 个答案:

答案 0 :(得分:2)

您不应该将mail()用于严肃的应用程序,因为它不会进行身份验证,并且由于这一点而在邮件服务器防火墙中被捕获。

相反,您应该使用SMTP PHP Class,例如。