html in mail function

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

html in mail function

Post by John Cartwright »

How would I format HTML into this...

Code: Select all

<?php
	  mail ($to, $subject, "
	   
	  Thank you for your purchase.
	  
	  Your Information:\n
	  
	  First Name:    ".$_SESSION['firstname']."\n
	  Last Name:     ".$_SESSION['lastname']."\n
	  License:       ".$_SESSION['timelicense']."\n
	  Hosting:       ".$_SESSION['hosting']."\n
	  Optionals:     ".$_SESSION['optional']."\n
	  IP:            $REMOTE_ADDR\n
	  
	  Total:         $ ".$_SESSION['total']." (USD)\n\n
	  
	  <a href="https://www.paypal.com/cgi-bin/webscr/$paypal">Click here to purchase.</a>\n\n
	  
	  From: ".$_SESSION['email']."\n");
?>
For example, simple things like line breaks...
If I put <br> it actually outputs the text <br>...and links <a href ....
I tried escaping the ?> tags but It wouldn't make a difference.
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

Have a look at:

viewtopic.php?t=19078

and then click on the first link in my signature ;)
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

ty i used one of the tutorials ty.
Post Reply