发送链接使用php mail()函数 [英] send link using php mail() function

查看:158
本文介绍了发送链接使用php mail()函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

用户应该收到以下格式的电子邮件:-----
复制令牌:xxxxx并粘贴到此链接 -----
我的代码:

User should get a email in the format:----- Copy the token: xxxxx And paste it in this Link ----- My codes:

$message="Copy the token:       ".
            token_generator(10)."       ".
            "And paste it in the link  "."<a href='recover_pass_get_mail.php'>Link</a>";

其中xxxxx由token_generator(10)函数返回。
但用户获取的格式代码是写入

where xxxxx is returned by token_generator(10) function. but user gets in the format code is written

推荐答案

似乎你的电子邮件功能没有很好的反应html标签,你可能在你的 $ header 对象中丢失了。

seems like your email function doesn't have good react with html tags, you probably missing this in you'r $header object.

$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";

阅读这个,
https://css-tricks.com/sending-nice-html-email-with-php/

它有很好的解释

这篇关于发送链接使用php mail()函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆