Click here to Skip to main content
15,892,059 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hello everybody,
I'm running a small script that should send the user an email, telling them what their new password is.

I have my variable:
PHP
$newPassword

And I have my HTML Email:
HTML
<html>
<body>
    <div class='container'>
        <img src='images/logos/small_logo.png' />
        <h4>Your password has been reset to the following:</h4>
        <p>" . $newPassword . "</p>
    </div>
</body>
</html>

I'm trying to pass the variable through in the html paragraph tags in my email, but the output is blank.

Any suggestions?

Regards,
Tom.
Posted
Comments
enhzflep 6-Sep-12 12:03pm    
<p><?php echo $newPassword; ?></p>
Andrei Straut 6-Sep-12 12:34pm    
You may wanna post it as a solution, it is the correct one too (I believe)
Joan M 6-Sep-12 13:23pm    
That should be an answer, not a comment it is more than correct. ;)

1 solution

I will post this myself, to close the question, although the credit should go to enhzflep, as he has been the first to answer. As a courtesy, I will upvote your first 5 answers I find in Q&A, provided they have been accepted or upvoted already.
Also, should you decide to post the solution yourself, just say so and I will delete mine

Solution:
Replace this line <p>" . $newPassword . "</p> with <p><?php echo $newPassword; ?></p>
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900