我在我的代码的最后部分,电子邮件验证。但是,电子邮件似乎没有正确发送。为了防止垃圾邮件,我将用_EMAIL_
替换我的电子邮件。PHP的email()函数没有发送正确的消息?
$hash = genRandomString();
$link = 'http://www.website.com/verify.php?email=' . $email . '&hash=' . $hash;
$message = 'Please confirm your email address by click this following link, or copy and pasting it into your web browser.'
. $link;
mail($email, 'Account verification for website.com', $message);
所有数据被正确地进入数据库(没有不正确的变量),但电子邮件来,虽然是这样的:
Please confirm your email address by click this following link, or copy and pasting it into your web browser.
_EMAIL_&hash=0uhcoawgi3qsek8l7rjoheo'>http://www.website.com/verify.php?email=_EMAIL_&hash=0uhcoawgi3qsek8l7rjoheo
我假设这是我做错了,但经过各种故障排除后我无法发现它。
看看你正在显示的输出,它看起来像脚本不是整个脚本。链接创建应该与一些HTML一起? –