首先,我是新来的 PHP :)。
我的问题是关于 SMTP 支持。我的代码正在发送恢复密码。但我的主机需要 smtp 支持。我没有添加它。我读了很多帖子,但我的知识基础。如何添加 smtp 支持?
function sendRecover($to, $title, $url, $from, $username, $salt) {
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: '.$title.' <'.$from.'>' . "\r\n";
$subject = 'Password Recovery - '.$title;
$message = 'A password recover was requested, if you didn\'t make this action please ignore this email. <br /><br />Your Username: <strong>'.$username.'</strong><br />Your Reset Key: <strong>'.$salt.'</strong><br /><br />You can reset your password by accessing the following link: <a href="'.$url.'/index.php?a=recover&r=1" target="_blank">'.$url.'/index.php?a=recover&r=1</a>';
return @mail($to, $subject, $message, $headers);
}