【问题标题】:HTML tag not working inside gmailHTML标签在gmail中不起作用
【发布时间】:2014-03-07 06:56:40
【问题描述】:

我这样发送这个链接:

<p>Some Message here</p>
<a href="http://www.test.com">Visit Site</a> 

但它的显示像

<p>Some Message here
http://www.test.com</p>

相当

  Some Message here
     Visit Site

你知道如何解决这个问题吗?

编辑

我使用此代码发送消息。

当消息是这样的时候

$msg ="
<p>Some Message here</p>
<a href='http://www.test.com'>Visit Site</a> 
";

Gmail 节目或其他电子邮件系统

这里有一些消息

访问网站

当消息是这样的时候

    $msg ="
    <p>Some Message here
http://www.test.com
</p>

    ";

Gmail 节目或其他电子邮件系统

这里有一些消息

http://www.test.com

为什么第一个不能作为链接工作

发送消息代码

$to = $user_email;
$subject = "My email"; 
$from = "email<noreply@test.com>"; 

$headers = "From: ".$from."\n";
$headers .= "Reply-To: ".$from."\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-Type: text/html; charset=iso-8859-1";

$mail_content = "<html><body>"; 
$mail_content .= $msg;
$mail_content .= "</body></html>";

【问题讨论】:

  • 因为htt:// 不是一个有效的协议?应该是http://...
  • 获胜的有效 HTML
  • 我已经更新了我的问题

标签: php email


【解决方案1】:

通过阅读您的问题,我还有一个问题,您是否在发送电子邮件之前设置了正确的标题。

因为链接是html元素,所以在发送电子邮件之前设置适当的标题应该可以解决您的问题。

除此之外,如果你仍然面临着然后分享你的发送电子邮件的代码。

这可能会有所帮助:http://in1.php.net/manual/en/function.mail.php

谢谢 阿米特

【讨论】:

  • 他说其他 html 作品,所以标题必须是正确的
  • 另外 OP 说in gmail...这里没有编程问题。
猜你喜欢
  • 2017-01-13
  • 2017-06-10
  • 1970-01-01
  • 2019-01-10
  • 2018-12-20
  • 2016-01-29
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多