我正在尝试将验证码电子邮件发送到我的网站,但是当我使用mail()函数时,它不会发送电子邮件。在四个参数(电子邮件,主题,消息,标题)中,我将其缩小为导致问题的消息。
这是我的消息代码:
$EmailMessage = "You've almost finished your Website account registration! Just ensure the following is correct and then click the link below to complete the process. /r/nUsername: " . $User . "/r/nPassword: " . $Password . "/r/nEmail: " . $Email . "/r/nDate of Birth: " . $DOB . "/r/nMailing List: " . $MailListMail . "/r/nComplete Registration: http://www.ThisIsAWebsite.com/validate-account.php?User=" . $User . "&ValCode=" . $ValCode;
让我们说这个背景
$User = 'Username'
$Password = 'Password'
$Email = 'email@email.com'
$DOB = '1/1/1990'
$MailListMail = 'Yes'
$ValCode = 'abcd1234A1'
正在使用的功能是
mail($Email,'Account Creation',$EmailMessage, 'From:AccountCreation@email.com');
如果$ EmailMessage设置为“Test”或类似的东西,则消息发送正常。
谁能看到我出错的地方?