Php邮件功能给出“错误550:发件人是垃圾邮件发送者”错误?

时间:2013-06-11 10:25:58

标签: php

这是我的PHP代码:

            $to = $email;
            $subject = "Email Confirmation";
            $message="<h1>Welcome to asdasd.</h1>";
            $message .= "<br /><br /><br /><h4>This mail has been sent by asdasd.com to confirm your email account.</h4>";
            $message .= "<p>To confirm your email account and continue to the site click on the following link:</p>";
            $message .= "<a href=\"http://localhost/asd"\"\">click here to continue</a>";
            $message .= "<br /><br /><p>If you have not signed up using this email or <br/>if you want to cancel your singup click here</p>";
            $header = "From:myrealemail@gmail.com \r\n";
            $header .= "MIME-Version: 1.0\r\n";
            $header .= "Content-type: text/html\r\n";
            ini_set("sendmail_from", "abcd@gmail.com");
            $retval = mail ($to,$subject,$message,$header);

可能是什么问题? 我正在使用这个服务器:smtp.bol.net.in 我可以使用localhost吗?

2 个答案:

答案 0 :(得分:0)

删除

ini_set("sendmail_from", "abcd@gmail.com");

答案 1 :(得分:0)

你在localhost中运行这段代码吗?邮件功能在localhost中不起作用。 并替换此行。

$message .= "<a href='http://localhost/asd'>click here to continue</a>";