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>
精彩评论