PHP - how to bold text in php mail - Asked By Olusegun A. on 24-Aug-10 06:44 AM

Hello friends

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

<?php

$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?

Web Star replied to Olusegun A. on 24-Aug-10 07:05 AM
you need to use custome font in php as in this article
http://iluvjohn.com/welcome-to-iluvjohn/custom-fonts-on-a-website-with-php-704/
Super Man replied to Olusegun A. on 24-Aug-10 08:24 AM

<?php

// multiple recipients

$to  = 'aidan@example.com' . ', '; // note the comma

$to .= 'wez@example.com';

 

// subject

$subject = 'Birthday Reminders for August';

 

// message

$message = '<b> Happy birthday </b>';

 

// To send HTML mail, the Content-type header must be set

$headers  = 'MIME-Version: 1.0' . "\r\n";

$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

 

// Additional headers

$headers .= 'To: Mary <mary@example.com>, Kelly <kelly@example.com>' . "\r\n";

$headers .= 'From: Birthday Reminder <birthday@example.com>' . "\r\n";

$headers .= 'Cc: birthdayarchive@example.com' . "\r\n";

$headers .= 'Bcc: birthdaycheck@example.com' . "\r\n";

 

// Mail it

mail($to, $subject, $message, $headers);

?>

DlennartD DlennartD replied to Super Man on 15-Oct-10 08:30 AM
TGHDF
DlennartD DlennartD replied to Super Man on 15-Oct-10 08:33 AM
This isn't working if you want to combine bold text with a variable like this:

Name: <b>$name</b>

Any idea how to solve this?