我正在尝试从我的localhost发送邮件,但是我从雅虎那里得到了这个奇怪的错误: -
Remote server replied: 553 Mail from 59.98.24.173 not allowed - 5.7.1 [BL21] Connections not accepted from IP addresses on Spamhaus PBL; see http://postmaster.yahoo.com/errors/550-bl21.html [550]
我正在使用HmailServer。 我的IP地址是动态的,每次我重置我的调制解调器,即使我有一个新的IP地址,我仍然从雅虎获得相同的消息。
我真的厌倦了雅虎。这是我发送邮件的代码: -
public static function sendMail($To , $Subject, $Body){
$from = 'noreply@testingmylocalhost.org';
ini_set('smtp_port',25);
ini_set('SMTP','localhost');
ini_set('sendmail_from',$from);
$headers = "From: $from\r\n";
$headers .= "Reply-To: ". $To . "\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=ISO-8859-1\r\n";
echo mail($To, $Subject, $Body);
}