【问题标题】:Email link not clickable in HTML Email phpHTML电子邮件php中的电子邮件链接不可点击
【发布时间】:2015-11-19 23:07:38
【问题描述】:

我发送一封带有 php 表单的电子邮件。当用户键入链接并提交通过 html/text 发送的表单电子邮件但链接无效时,我有“消息”字段。如何设置链接处于活动状态?

 $body = '<html><body>';
 $body .= '<table width="770" border="1">';
 $body .= '<tr><th colspan="2" bgcolor="#4e604a" scope="col" style="color: white">Order</th></tr>';
 $body .= '<tr><td width="91" align="center" bgcolor="#D6D6D6"><strong>Name:</strong></td><td width="663"> ' . $name . ' </td></tr>';
 $body .= '<tr><td align="center" bgcolor="#D6D6D6"><strong>Email:</strong></td><td> ' .$email . ' </td></tr>';
 $body .= '<tr><td colspan="2" align="center" bgcolor="#4E604A" style="color: white"><strong>Message:</strong></td></tr>';
 $body .= '<tr><td colspan="2" style="word-wrap: 80px"><pre style="font-size: 14px">' . $message . ' </pre></td></tr>';
 $body .= '</table>';
 $body .= '</body></html>';


(来源:fotkica.com

【问题讨论】:

标签: php email phpmailer


【解决方案1】:

这是在 HTML 中写 a link 的方法:

<a href="http://stackoverflow.com/questions/33816048/">This is a link</a>

请注意,您还将在 &lt;pre&gt; element 中打印您的 $message 变量,该变量用于预格式化文本,因此无论如何您都无法在其中创建链接。

【讨论】:

  • 我知道,但是当用户访问我的网站时,他不会输入 blabla.com
  • 您不是在用户的浏览器上打字。您正在编写 HTML 文档并通过电子邮件发送。
  • 我的 php 表单没有给我发送可点击的链接。看我第一篇文章的图片。我想要活动的可点击链接...
猜你喜欢
  • 2016-03-22
  • 2015-06-13
  • 2011-09-03
  • 1970-01-01
  • 2011-09-21
  • 2023-03-30
  • 1970-01-01
  • 2012-11-28
  • 2018-10-18
相关资源
最近更新 更多