tags:

views:

46

answers:

2

This is a simple question. I am using the libmail class to send my mails. For composing the mails I am using the CKEditor. My problem is that when I send the mail to someone the mail is displaying like this:

<p><span style="color: rgb(255, 160, 122);">data</span></p>

I already tried this:

$message = htmlspecialchars(stripslashes($message));

And:

$message =  htmlentities($message);

Still it does the same thing.

A: 

You appear to be using: http://www.phpkode.com/source/s/libmail2008/libmail2008/libmail_161php5.php

Looking at that class, I see a Html method. So if you want to add HTML with charset UTF-8, use:

$mail = new Mail;
$mail->To('[email protected]');
$mail->Html('<b>boldfaced</b>', 'UTF-8');
$mail->Send();
Lekensteyn
i am using the "libmail_161php5.php"
Meena
if i change the $mail->Body('<b>boldfaced</b>', 'UTF-8'); into $mail->Html('<b>boldfaced</b>', 'UTF-8'); my mail is not sending Is there is any other way to solve this
Meena
Do you get any errors? Turn `error_reporting(E_ALL);` on.
Lekensteyn
A: 

Try html_entity_decode http://php.net/manual/en/function.html-entity-decode.php

Petah