我发一个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)不正常