ms.buggy Posted November 6, 2009 Share Posted November 6, 2009 Im trying to sen an email with content is picked up from a rtf-file (file_get_contents('*.rtf'). Mail is sent correctly, but the formatting of the content includes rtf formatting like: "{\f2\fs20\insrsid8807860 Place:" for example, and not just the content text "Place". I was assuming that the problem is with the 'Content-type' and 'Content-Transfer-Encoding', but after googleing about this rtf/mail issue, I'm getting the feeling that maybe this problem wont be so easy. Thanks in advance. -ms.B Quote Link to comment Share on other sites More sharing options...
ms.buggy Posted November 9, 2009 Author Share Posted November 9, 2009 Is there any way to format text content in email, like underlining or italic, to mail that is sent in plain/text? Quote Link to comment Share on other sites More sharing options...
trq Posted November 9, 2009 Share Posted November 9, 2009 Is there any way to format text content in email, like underlining or italic, to mail that is sent in plain/text? Not in plain text no. You would need to send it as html. Quote Link to comment Share on other sites More sharing options...
ms.buggy Posted November 9, 2009 Author Share Posted November 9, 2009 Ok, thanks. I think this is pretty lame, becouse simple formatting is so light / easy to do in different email programs, like outlook and gmail. I managed to do underlining by usign txt instead of rtf, and with underscore the phrase in my txt file(_phrase_). So now the "higlighted" sentance is underlined in the message that is sent (atleast when read in thunderbird or gmail), used content type is text/plain. Are these _old fashioned ways_ good / reliable or even safe way to do some simple text formatting for emails, where content is read and inserted from separeted file (txt, rtf, etc..). Also, I noticed that when the formatting is done in gmail, the content type is set to multipart/alternative, could there perhaps be some kind of table of the tags used in this content type -coding? -ms.buggy Quote Link to comment Share on other sites More sharing options...
trq Posted November 9, 2009 Share Posted November 9, 2009 The simple fact is that emails where designed to be plain text. Allot of people still switch there email clients to plain text to avoid pictures being loaded for example. rtf is a microsoft propriety format. If you want to format your emails with more detail your best bet is to use html, be aware though, that not all client will have this enabled. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.