sphinx Posted September 22, 2011 Share Posted September 22, 2011 Hi there, This doesn't seem to echo as attempted, is their a way of doing this? $body2 = "Hello $name, \n <strong>I want to make this paragraph bold!</strong>\n"; Displays as: Hello John Smith, <strong>I want to make this paragraph bold!</strong> I want to format the text making it bold, but it displays the <strong> tags. Thanks Link to comment https://forums.phpfreaks.com/topic/247657-adding-text-formatting/ Share on other sites More sharing options...
Pikachu2000 Posted September 22, 2011 Share Posted September 22, 2011 What happens to that variable between there and where you echo it? Link to comment https://forums.phpfreaks.com/topic/247657-adding-text-formatting/#findComment-1271767 Share on other sites More sharing options...
sphinx Posted September 22, 2011 Author Share Posted September 22, 2011 What happens to that variable between there and where you echo it? Thanks for your reply, it's actually echoed as an email 'donotreply' confirmation email: mail($confirmation, $consubject, $body2,$headers2); Link to comment https://forums.phpfreaks.com/topic/247657-adding-text-formatting/#findComment-1271768 Share on other sites More sharing options...
Buddski Posted September 22, 2011 Share Posted September 22, 2011 What headers are you sending your email with. My guess is you are sending a plain/text email. Link to comment https://forums.phpfreaks.com/topic/247657-adding-text-formatting/#findComment-1271770 Share on other sites More sharing options...
sphinx Posted September 22, 2011 Author Share Posted September 22, 2011 Aha, most likely $fromnoreply = '[email protected]'; $headers2 = "From: $fromnoreply \r\n"; $headers2 .= ""; Link to comment https://forums.phpfreaks.com/topic/247657-adding-text-formatting/#findComment-1271771 Share on other sites More sharing options...
Buddski Posted September 22, 2011 Share Posted September 22, 2011 Chuck in a few more headers like $headers2 . = 'MIME-Version: 1.0' . "\r\n"; $headers2 .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; And dont forget \n in a text/html content-type will do nothing (visibly speaking). Switch them to break tags. Link to comment https://forums.phpfreaks.com/topic/247657-adding-text-formatting/#findComment-1271774 Share on other sites More sharing options...
sphinx Posted September 22, 2011 Author Share Posted September 22, 2011 Sweet stuff, ThAnK You! Link to comment https://forums.phpfreaks.com/topic/247657-adding-text-formatting/#findComment-1271777 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.