开发者

using php variables in a html email using swiftmailer

Im using swiftmailer to send my emails from my site. I'm trying to get a html email to send but i want to pass开发者_如何学Python a php variable in to the email.

Is this possible and if so where am i going wrong?

->setBody(
    '<html>' .
    ' <head></head>' .
        ' <body>' .
    '  Welcome to my site. To complete registration, please click activate below' .
    '  <a href="http://www.mysite.com/activate.php?=c' rawurlencode ($code)' ">activate  ' .
    ' </body>' .
    '</html>',
    'text/html'
);


I don't understand why you are using this

<?php rawurlencode ($code);?>

unless than

rawurlencode ($code)


<pre>
->setBody(
    '<html>' .
    ' <head></head>' .
        ' <body>' .
    '  Welcome to my site. To complete registration, please click activate below' .
    '  <a href="http://www.mysite.com/activate.php?=c'. rawurlencode ($code) .' ">activate  ' .
    ' </body>' .
    '</html>',
    'text/html'
);
</pre>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜