Jump to content

Send Email With $Email Variable Displayed


aquatradehub

Recommended Posts

Hi, I have this code to send an email once a user has registered. I would like to display the $email variable in the email, but the validation link just shows up exactly as it was written, and does not display the $email variable as it should be; the persons email address. It sends the email ok, so I am confused as to why it is not displayed.

 

Sorry, I cannot select the code tags.

 

/* Send validation email */

 

// recipients

 

// subject

$subject = 'AquaTradeHub.com Validation Email';

 

// message

$message = '

<p>Thank you for registering with AquaTradeHub.com</p>

<br>

<p>Please validate your account <a href="http://www.zambiheadshop.com/validate.php?email=$email">Click here</a>';

 

// To send HTML mail, the Content-type header must be set

$headers = 'MIME-Version: 1.0' . "\r\n";

$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

 

// Additional headers

$headers .= 'From: AquaTradeHub.com <[email protected]>' . "\r\n";

 

// Mail it

mail($email, $subject, $message, $headers);

 

 

/* Redirect visitor to the thank you page */

 

header('Location: thanks.php');

exit();

}}

 

Any help is much appreciated.

 

The email variable is defined earlier in the script.

whoa, calm down lol, some of us are pretty new to this. Anyway, I got what u said, and now it works

 

/* Send validation email */

 

// recipients

 

// subject

$subject = 'AquaTradeHub.com Validation Email';

 

// message

$message = "

<p>Thank you for registering with AquaTradeHub.com</p>

<br>

<p>Please validate your account <a href='http://www.zambiheadshop.com/validate.php?email=$email'>Click here</a>";

 

// To send HTML mail, the Content-type header must be set

$headers = 'MIME-Version: 1.0' . "\r\n";

$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

 

// Additional headers

$headers .= 'From: AquaTradeHub.com <[email protected]>' . "\r\n";

 

// Mail it

mail($email, $subject, $message, $headers);

 

 

/* Redirect visitor to the thank you page */

 

header('Location: thanks.php');

exit();

}}

 

Thanks :)

As I said at the beginning of this topic

 

" Sorry, I cannot select the code tags."

 

I dont know why, but I cant change font, size, code, link whatever, its all pale and does not do anything when I click on them apart from highlighting that icon :(

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.