Page 1 of 1

how to bold text in php mail

Posted: Tue Aug 24, 2010 5:41 am
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?

Re: how to bold text in php mail

Posted: Tue Aug 24, 2010 5:55 am
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.

Re: how to bold text in php mail

Posted: Wed Aug 25, 2010 4:36 am
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";

Re: how to bold text in php mail

Posted: Wed Aug 25, 2010 6:41 am
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.