Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/243.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Yii使用PHPMailer在邮件正文中发送自定义url_Php_Yii_Phpmailer - Fatal编程技术网

Yii使用PHPMailer在邮件正文中发送自定义url

Yii使用PHPMailer在邮件正文中发送自定义url,php,yii,phpmailer,Php,Yii,Phpmailer,我有一个使用PHPMailer发送邮件的webapp。 我已经生成了一个url,它需要与邮件正文连接起来 $url=$this->createUrl($route,$params); //creates url $mail->Body = $url; // to concatenate with the body. $mail->MsgHTML($_POST['Model']['body']); // not getting included 此正文已被写入页面的正文字段。

我有一个使用PHPMailer发送邮件的webapp。 我已经生成了一个url,它需要与邮件正文连接起来

$url=$this->createUrl($route,$params); //creates url
$mail->Body = $url; // to concatenate with the body.
$mail->MsgHTML($_POST['Model']['body']); // not getting included
此正文已被写入页面的正文字段。
如何在电子邮件中包含url?

我不太清楚哪一个url现在会覆盖另一个url,但通常您可以先将url与正文连接起来,然后将其分配给电子邮件

$url=$this->createUrl($route,$params); //creates url
$body = $_POST['Model']['body'] . $url; // concatenate body with url

$mail->Body = $body; // either this
$mail->MsgHTML($body); // or this (do not know which works for you)