문제

I have a webapp to send mails using PHPMailer. I have generated a url which needs to be concatenated with the body of the mail.

$url=$this->createUrl($route,$params); //creates url
$mail->Body = $url; // to concatenate with the body.
$mail->MsgHTML($_POST['Model']['body']); // not getting included

This "body" is getting over written with the "body" field of the page. How can I include the url in my email?

도움이 되었습니까?

해결책

I do not exactly understand which one now overwrites the other one, but generally you could first concatenate the URL with the BODY and then assign it to the Email.

$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)
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top