how to bold text in php mail

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
adsegzy
Forum Contributor
Posts: 184
Joined: Tue Jul 28, 2009 9:26 am

how to bold text in php mail

Post by adsegzy »

Hello friends

Am having problem bolding my text or applying other styles to my mail content. eg

Code: Select all

$message= "Name: <b>$name</b>";
the message always appear in the receivers box as

Name: <b>James</b> instead of

Name: James

What do i do?
User avatar
greyhoundcode
Forum Regular
Posts: 613
Joined: Mon Feb 11, 2008 4:22 am

Re: how to bold text in php mail

Post by greyhoundcode »

Are you sending the email as HTML or plain text?

You could always use an existing component to do the hard work for you.
amargharat
Forum Commoner
Posts: 82
Joined: Wed Sep 16, 2009 2:43 am
Location: Mumbai, India
Contact:

Re: how to bold text in php mail

Post by amargharat »

use following code in ur headers,

Code: Select all

$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";
internet-solution
Forum Contributor
Posts: 220
Joined: Thu May 27, 2010 6:27 am
Location: UK

Re: how to bold text in php mail

Post by internet-solution »

amargharat wrote:use following code in ur headers,

Code: Select all

$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";
Then you will have to use HTML bold tag <b> </b> to make text bold in your message.
Post Reply