我试图找到解决方案,但到目前为止,我找不到任何适合我问题的方法。
我想向每个新用户发送注册邮件,这是我邮件的PHP:
<?php
$message = '<html>
<body>
<p>Hi ' . $fname . ',</br></br>
welcome!</p>
<p>
<a href="\http://www.home.com/en/verification.php?id=' . $db_id . '&code=' . $code . '\">Please click this link</a> to activate your account.</p>
<p>We hope you enjoy our page and are happy to hear about your experiences!</p>
<p>Your team</p>';
$header = "MIME-Version: 1.0\r\n";
$header .= "Content-type: text/html; charset=iso-8859-1\r\n";
$header .= "From: Sender <sender@sender.com>";
$header .= "X-Mailer: PHP ". phpversion();
mail($email, 'Thank you for registering!', $message, $header);
?>
链接在我的邮件中无法正常工作。在Outlook中,我的Href显示在括号中(例如[http://www.home.com/en/verification.php?id=4&code=5]),在Gmail中,只显示我的链接说明,但我无法点击该链接。
有谁可以帮助我?
答案 0 :(得分:0)
您的标记不正确:
<br/>
而不是</br>
。
<?php
$message = '<p>Hi ' . $fname . ',<br/><br/>welcome!</p><p><a href="http://www.home.com/en/verification.php?id=' . $db_id . '&code=' . $code . '">Please click this link</a> to activate your account.</p><p>We hope you enjoy our page and are happy to hear about your experiences!</p><p>Your team</p>';
$header = "MIME-Version: 1.0\r\n";
$header .= "Content-type: text/html; charset=iso-8859-1\r\n";
$header .= "From: Sender <sender@sender.com>";
$header .= "X-Mailer: PHP ". phpversion();
mail($email, 'Thank you for registering!', $message, $header);
?>
答案 1 :(得分:0)
不需要逃生。
<a href="http://www.home.com/en/verification.php?id=' . $db_id . '&code=' . $code . '">Please click this link</a> to activate your account.</p>