yii2 邮件发送

bichir 2015-09-15 08:09:44
我发一个url地址到某邮件,但是不能用&连接参数
如内容:http://localhost:8080/YIYIOA/frontend/web/index.php?r=/site/edit-week-target&id=12
发过去只能看到http://localhost:8080/YIYIOA/frontend/web/index.php?r=/site/edit-week-target
我把&符号换成?号或其他符号又能正常显示,这是为啥呢,网上找不到相关资料,
源码是这样的
 $mail =  Yii::$app->getMailer()->compose();
$mail->setTo($array)
->setSubject($title)
->setHtmlBody($content)
->send();

我把setHtmlBody换成setTextBody也试过也是一样的
补充:
发送的内容我是放在变量$content里的,所以会这种情况,如果我把发送内容直接写成死字符串就正常
如setHtmlBody("http://localhost:8080/YIYIOA/frontend/web/index.php?r=/site/edit-week-target&id=12") 正常
$content = "http://localhost:8080/YIYIOA/frontend/web/index.php?r=/site/edit-week-target&id=12";
setHtmlBody($content)不正常
...全文
131 回复 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

20,397

社区成员

发帖
与我相关
我的任务
社区描述
“超文本预处理器”,是在服务器端执行的脚本语言,尤其适用于Web开发并可嵌入HTML中。PHP语法利用了C、Java和Perl,该语言的主要目标是允许web开发人员快速编写动态网页。
phpphpstorm 技术论坛(原bbs)
社区管理员
  • 开源资源社区
  • phpstory
  • xuzuning
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧