spires Posted August 18, 2006 Share Posted August 18, 2006 hi Quote Link to comment Share on other sites More sharing options...
corbin Posted August 18, 2006 Share Posted August 18, 2006 http://us2.php.net/reserved.variablesYou should be able to figured it out from that. Quote Link to comment Share on other sites More sharing options...
Woolf Posted August 18, 2006 Share Posted August 18, 2006 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] 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.