0

这是我的 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 代替吗?

4

2 回答 2

0

消除

ini_set("sendmail_from", "abcd@gmail.com");
于 2013-06-11T10:27:51.640 回答
0

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

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

于 2013-06-11T11:06:24.650 回答