Jump to content

Archived

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

spires

simple question

Recommended Posts

http://us2.php.net/reserved.variables

You should be able to figured it out from that.

Share this post


Link to post
Share on other sites
In order to send HTML code (that means <a href=... links) in an e-mail, you must let the script know that your message contains html. In theory, this should work:

[code]$link = '<a href="nickyrubin.com/members">login</a>';
$to      = $buyer_email;
$subject = 'Hi '.$firstname.', Nicky Rubin Would like to thank you';
$message = 'Hi '.$firstname.'
Thank you for buying from nickyrubin.com
Here is you username and password
USERNAME = '.$buyer_email.'
PASSWORD = '.$password.'
Please login here'.$link.'';
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

mail($to, $subject, $message, $headers);
  $enter = '<div class="error">An email has been sent containing your username and password.</div>';[/code]

What is in the $headers variable lets the script know it should be formatted as HTML. Please note, however, that means that you must format the rest of your message in HTML. For example, you cannot just format a new line by using a return, you must use < br > (without the spaces) instead.

e.g.

[code]$link = '<a href="nickyrubin.com/members">login</a>';
$to      = $buyer_email;
$subject = 'Hi '.$firstname.', Nicky Rubin Would like to thank you';
$message = 'Hi '.$firstname.'<br>
Thank you for buying from nickyrubin.com<br>
Here is you username and password<br>
USERNAME = '.$buyer_email.'<br>
PASSWORD = '.$password.'<br>
Please login here'.$link.'';<br>
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

mail($to, $subject, $message, $headers);
  $enter = '<div class="error">An email has been sent containing your username and password.</div>';[/code]

Share this post


Link to post
Share on other sites

×

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.