Heim  >  Artikel  >  Backend-Entwicklung  >  php 邮件内容加链接解决方法

php 邮件内容加链接解决方法

WBOY
WBOYOriginal
2016-06-13 10:12:03890Durchsuche

php 邮件内容加链接
php 邮件内容加链接
----------------------
baidu 这样直接写上去不行,发送到邮件那查看也是这样一模一样的显示代码,不能点击连接

不知道还有没有其他办法?

------解决方案--------------------
不会吧!你加个header("Content-Type:text/html"),在你发的信息中加入这个设置下解析方式吧!具体加的方式可能要根据你哪的实际情况了
------解决方案--------------------

phpmailer库发送邮件
------解决方案--------------------
将链接转成html标记码,放入邮件,读取时再解析出来。如:

PHP code
$orig = "I'll \"walk\" the <b>dog</b> now";$a = htmlentities($orig);$b = html_entity_decode($a);echo $a; // I'll "walk" the <b>dog</b> nowecho $b; // I'll "walk" the <b>dog</b> now<br><font color="#e78608">------解决方案--------------------</font><br>邮件是可以指定格式的,如果是纯字符的,就会像你说的那样,html部分都直接显示了<br>但可以指定邮件是html格式的,就不会出现这种情况。<br>绝大多数的smtp服务器和php发邮件的脚本都支持指定html格式的邮件内容<div class="clear">
                 
              
              
        
            </div>
Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn