I send email using php mailer successfully to reset password. In the content of the email I provide with a link to click on to reset password. That link will actually take to reset_password.php page in my server. I also want to pass email id only for now, in the link so that can be retrieved by reset_password.php page..
<?php
session_start();
$email2=$_SESSION['emailto'];
?>
<p>Click on the following link to reset your password.<a href="http://sample-site.com/reset_password.php?email=<?php echo $email2;?>">Login</a>.</p>
The above line resides in reset_password.php page and I include it like below in the page that I send email:
$mail->msgHTML(file_get_contents('email-content.php'), dirname(__FILE__));
How do I get the valie of variable $email2 value reflected in the link sent through the email, please?
Can $mail->msgHTML
contain php variables?
I tried something like this, but doesn't help.
$mail -> msgHTML(str_replace($email3, $email2, file_get_contents('email-content.php')), dirname(__FILE__));
AND HTML
<p>Click on the following link to reset your password.<a href="http://localhost/reset_password.php?email=<?php echo $email3;?>">Reset Password</a>.</p>
This si what I see in the browser URL when the link is clicked.
http://sample-site.com/reset_password.php?email=%3C?php%20echo%20$email3;?%3E