Yii使用PHPMailer在邮件正文中发送自定义url
我有一个使用PHPMailer发送邮件的webapp。 我已经生成了一个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 此正文已被写入页面的正文字段。
$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)