Jump to content

sending variables in an email


herghost

Recommended Posts

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

 

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.