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 <validate@aquatradehub.com>' . "\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.

Edited by aquatradehub
Link to comment
Share on other sites

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 <validate@aquatradehub.com>' . "\r\n";

 

// Mail it

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

 

 

/* Redirect visitor to the thank you page */

 

header('Location: thanks.php');

exit();

}}

 

Thanks :)

Link to comment
Share on other sites

Click the lightswitch in the top left. Does that change it?

Are you selecting the text and then clicking the icon? What browser are you using? etc.

 

Also, you can just type [ code ] and [ /code] without the spaces.

Edited by Jessica
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.