无法通过OpenShift中的php邮件发送邮件

时间:2013-12-15 14:03:40

标签: php email

我一直在尝试一些PHP代码,我无法通过以下代码发送邮件。我已经发送了几天,但现在mail()函数返回true但邮件不在收件人的收件箱中。这是代码:

$to = "test@example.com";
$subject = "Testing Emails";
$emailBody = "Hello";
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";
$headers .= "From: Test <no-reply@example.com>" . "\r\n";
$headers .= "Reply-To: no-reply@example.com"."\r\n";
$mail = mail($to,$subject,$emailBody,$headers);

if($mail){    
    echo 'Successfully sent';
} else {
    echo 'Failed to send';
}

注意:我已将所有to地址替换为原始地址。

0 个答案:

没有答案