电子邮件发送不可点击 url 注册后 PHP

Email send not clickable url after registration PHP

我的问题出在用户注册后发送的电子邮件中。当您收到一封用于验证帐户的电子邮件时,link 您需要使用浏览器访问以验证您的帐户。

此 link 不可点击,您必须将其复制并粘贴到您的浏览器中。 但我需要让它可以点击。我在我的 php 文件中找到了 link 的来源。

邮箱验证link源代码

'.get_bloginfo('url').'/?ekey='.$emailhash;

整个来源是

                $body = _d('Hello',17).' '.$yourname.'<br /><br />
'._d('Before you can use the site you will need to validate your email address.',795).'
'._d('If you don\'t validate your email in the next 3 days your account will be deleted.',960).'<br /><br />
'._d('Please validate your email address by clicking the link bellow',1025).': </br>
<a href="<?php echo get_bloginfo('url') . '/?ekey=' . $emailhash; ?>">some link</a>

                escort_email("", "", $youremail, _d('Email validation link',1026)." ".get_option("email_sitename"), $body); 

有没有办法让它像 href 标签或类似的东西一样可以点击?

谢谢。

HTML 锚点看起来像这样

<a href="http://www.example.com">some link</a>

您需要连接要显示的 link,即..

get_bloginfo('url') . '/?ekey=' . $emailhash

以便它替换上面的“example.com link。

你可以这样做...

<a href="<?php echo get_bloginfo('url') . '/?ekey=' . $emailhash; ?>">some link</a>

编辑:试试这个代码:

为了响应 opies 更新的代码...您的锚标记已经在 php 标记内被回显,因此解决方案如下:

<?php    
<a href="<?php echo get_bloginfo('url') . '/?ekey=' . $emailhash; ?>">some link</a>
?>

将会失败,因为我们不能嵌套 <?php ?> 标签。

解决方案是简单地 连接 您想要的值到回显 html 中,如下所示:

$body = _d('Hello', 17) . ' ' . $yourname . '
<br />
<br />
' . _d('Before you can use the site you will need to validate your email address.',795) . '
' . _d('If you don\'t validate your email in the next 3 days your account will be deleted.',960).'<br /><br />
' . _d('Please validate your email address by clicking the link bellow',1025). ':
</br>
<a href="' . get_bloginfo('url') . '/?ekey=' . $emailhash . '">some link</a>';

escort_email("", "", $youremail, _d('Email validation link',1026)." ".get_option("email_sitename"), $body);