Hi,
I am using CKEditor 4.1.1 and am having issues getting emails sent out by PHP to implement the formatting. The formatting code is currently displaying within the email. I am calling the following under my textarea:
<textarea type="text" id="message" name="message" size="32"/></textarea>
<script>
CKEDITOR.replace( 'message', {
toolbar: 'Basic',
language: 'en'
});
</script>
This PHP brings the text into the PHP:
$message = $_POST['message'];
and this is some of the PHP that is in the email building message:
"$message"."\n";
I have had a look for support for this but have been unseccessful. Is CKEditor able to bring the formating into an email in such a way? If so I am guessing something could be wrong with my syntax?
Thanks for any help!
I guess you use the mail()
I guess you use the mail() function to send you e-mail.
You should try simply adding beggining your message with <body><html> and end it with </body></html>, that could solve your problem.
In this example the text generated by CKE is in the variable $message, and the charset is UTF-8 :
$message =
"<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" /></head><body>"
. $message
. "</body></html>";
In your message header you can specify the content type and charset (in this example the charset is utf-8)
$header.= 'MIME-Version: 1.0' . "\r\n";
$header.= 'Content-type: text/html; charset=utf-8' . "\r\n";