开发者

using php variables in a html email using swiftmailer

开发者 https://www.devze.com 2023-04-10 15:36 出处:网络
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.

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

精彩评论

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