954,587 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Using HTML tags in PHP code

Is it possible to use HTML tags in PHP code? I have a php script that emails some form inputs to my email address, and I would like to bold certain words in it. The code preforms the message first, and then just posts the message in the body of the email like this:

$body = "Date Submitted: $today\n Client: $client\n From: $requestor\n $services";


I would like to make some words bold. Like the word Client. In that body message, how can I make it come up bold in the email?
Thanks.

nathanpacker
Posting Whiz in Training
234 posts since May 2005
Reputation Points: 10
Solved Threads: 0
 

Use the content-type:text/html instead of content-type:text/plain header when sending off the email.

cscgal
The Queen of DaniWeb
Administrator
19,433 posts since Feb 2002
Reputation Points: 1,474
Solved Threads: 230
 
Use the content-type:text/html instead of content-type:text/plain header when sending off the email.

Thanks cscgal. Kudos to you for being so involved in your forum. I swear you answer almost every post, and I don't know how you do it!

But if I may bother you once more, where do I include this content-type:text/plain? At the heading of the php script or something? I wrote the script by hand, so it's very unformal, and probably not really legit.

Thanks again!
Nate

nathanpacker
Posting Whiz in Training
234 posts since May 2005
Reputation Points: 10
Solved Threads: 0
 

Here are the birthdays upcoming in August!



PersonDayMonthYear
Joe3rdAugust1970
Sally17thAugust1973

cscgal
The Queen of DaniWeb
Administrator
19,433 posts since Feb 2002
Reputation Points: 1,474
Solved Threads: 230
 

Thanks, that clears it up nicely. You're awesome! Have a nice night.

nathanpacker
Posting Whiz in Training
234 posts since May 2005
Reputation Points: 10
Solved Threads: 0
 

You're welcome. Oh, and just for the record, it's a complete illusion that I post a lot :)

cscgal
The Queen of DaniWeb
Administrator
19,433 posts since Feb 2002
Reputation Points: 1,474
Solved Threads: 230
 

Coulda fooled me ;-)

nathanpacker
Posting Whiz in Training
234 posts since May 2005
Reputation Points: 10
Solved Threads: 0
 
I swear you answer almost every post, and I don't know how you do it!

She gets here before me, that's how she does it. lol :-)

Take a look here for some ideas: http://krijnhoetmer.nl/stuff/php/html-plain-text-mail/

Puckdropper
Posting Pro
500 posts since Jul 2004
Reputation Points: 23
Solved Threads: 23
 

Fooled me... I just took 5 minutes to answer this post and she's posted again! (-:

Puckdropper
Posting Pro
500 posts since Jul 2004
Reputation Points: 23
Solved Threads: 23
 

Maybe she's got a DaniBot that answers for her. :twisted:

nathanpacker
Posting Whiz in Training
234 posts since May 2005
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You