I have an email sending web application and for text formatting I need to implement a WYSIWYG editor for email body. I have tried Tinymce and fckeditor but the major problem with these editors being that they output <div>
and <span>
tags with inline style. Most email clients like outlook and even gmail simply rip off any css and hence they are of no use.
I went ahead with TinyMCE and used the following configuration for font colors:
<script>
tinyMCE.init({
theme_advanced_buttons1_add : "forecolor,backcolor",
tinymce.init({selector:'textarea'});
});
</script>
As said above, I get <span style="font-color:#ff0000">Text here</span>
when I try to add red color to a portion of text. This gets removed by both Gmail and outlook and what the receiver gets is black text. No fonts, no font colors. What mail clients understand is the old <font>
tag.
My question: How can I tweak tinymce (or fckeditor) to output <font>
tags instead of <span>
? I could not find a useful solution in their documentation. It would also help if anyone can suggest any other email friendly text editors out there.
A similar question is here but without a solution: Create a html wysiwyg editor for editing email templates
font-family
andcolor
as supported by webmail and outlook. However, as I have already mentioned the code above sent via phpmailer, it ddnt work in gmail and outlook both. However,<b>
tags worked fine. I don't understand why. I will check the list mentioned in your link again. – Zeeshan