herghost Posted November 25, 2010 Share Posted November 25, 2010 Good afternoon everyone, probably just a quick one this one! I have a reg form, and once the user has been added to the database then it is meant to send them an email with their username and password. The email works fine, received as it should, however the place where I am trying to echo variables is blank. For instance <style type='text/css'> h3 { font-family: Tahoma, Geneva, sans-serif; font-size: 24px; font-style: oblique; color: #00F; } </style> <body> <img src='https://www.buy2earn.co.uk/images/logo.png' width='240' height='100'> <hr> <h3>Welcome to buy2earn.co.uk!</h3> <p> Welcome <?php echo $username:?> just shows Welcome ................... How do I send the variables in the email? Cheers Quote Link to comment Share on other sites More sharing options...
seanlim Posted November 25, 2010 Share Posted November 25, 2010 Please provide the context of using the above HTML code. Also, i don't think there should be a colon at the end of the echo statement. Quote Link to comment Share on other sites More sharing options...
herghost Posted November 25, 2010 Author Share Posted November 25, 2010 oops, shit sorry, thought I posted more of the script! it is a php script using phpmail $mail->From = "register@buy2earn.co.uk"; $mail->FromName = "Buy2Earn.co.uk"; $mail->AddAddress("$email"); $mail->WordWrap = 50; // set word wrap to 50 characters // optional name $mail->IsHTML(true); // set email format to HTML $mail->Subject = "Thank you for registering at Buy2Earn.co.uk"; $mail->Body = "<style type='text/css'> h3 { font-family: Tahoma, Geneva, sans-serif; font-size: 24px; font-style: oblique; color: #00F; } </style> <body> <img src='https://www.buy2earn.co.uk/images/logo.png' width='240' height='100'> <hr> <h3>Welcome to buy2earn.co.uk!</h3> <p> Welcome <?php echo $username;?> yup, that should have been an ;, however still doesnt print Quote Link to comment Share on other sites More sharing options...
seanlim Posted November 25, 2010 Share Posted November 25, 2010 you won't need those php tags i.e. <?php ... ?> simply do this: $mail->Body = "<style type='text/css'> ... Welcome $username ..."; Quote Link to comment Share on other sites More sharing options...
herghost Posted November 25, 2010 Author Share Posted November 25, 2010 aaah, that simple eh? Thanks a lot Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.