I
found the code. It still may need some fine tuning.
<CFSET x =
FindNoCase("<body",HTMLMessage)>
<CFSET strPlainTextMessage = RemoveChars(HTMLMessage, 1, x-1)>
<CFSET strPlainTextMessage = Replace(strPlainTextMessage,chr(13),"","all")>
<CFSET strPlainTextMessage = Replace(strPlainTextMessage,chr(10),"","all")>
<CFSET strPlainTextMessage = ReplaceNoCase(strPlainTextMessage,"<br>",chr(13)&chr(10),"all")>
<CFSET strPlainTextMessage = ReplaceNoCase(strPlainTextMessage,"<p>",chr(13)&chr(10)&chr(13)&chr(10),"all")>
<CFSET strPlainTextMessage = ReReplaceNoCase(strPlainTextMessage, " ", " ", "all")>
<CFSET strPlainTextMessage = ReReplaceNoCase(strPlainTextMessage, "<[^>]*>", "", "all")>
<CFSET strPlainTextMessage = RemoveChars(HTMLMessage, 1, x-1)>
<CFSET strPlainTextMessage = Replace(strPlainTextMessage,chr(13),"","all")>
<CFSET strPlainTextMessage = Replace(strPlainTextMessage,chr(10),"","all")>
<CFSET strPlainTextMessage = ReplaceNoCase(strPlainTextMessage,"<br>",chr(13)&chr(10),"all")>
<CFSET strPlainTextMessage = ReplaceNoCase(strPlainTextMessage,"<p>",chr(13)&chr(10)&chr(13)&chr(10),"all")>
<CFSET strPlainTextMessage = ReReplaceNoCase(strPlainTextMessage, " ", " ", "all")>
<CFSET strPlainTextMessage = ReReplaceNoCase(strPlainTextMessage, "<[^>]*>", "", "all")>
-----Original Message-----
From: Marc Lichtenfeld
Sent: Wednesday, June 26, 2002 2:15 PM
To: inFusion Support List
Subject: RE: [iMS] HTML Message --> Text MessageI can't find the exact code that I am planning on using (it is hidden in my test environment somewhere), but something like this should do:<CFSET PlainTextMessage = ReplaceNoCase(HTMLMessage,"<br>",chr(13) & chr(10), "all")> <!--- Convert Line Breaks ---><CFSET PlainTextMessage = ReplaceNoCase(PlainTextMessage ,"<p>",chr(13) & chr(10) & chr(13) & chr(10), "all")> <!--- Convert Paragraphs ---><CFSET PlainTextMessage = ReReplaceNoCase(PlainTextMessage , "<[^>]*>", "", "all")> <!--- Strip HTML --->It isn't always perfect. You may want to create something that removes everything before and including the <body> tag before running the above code.-----Original Message-----
From: William Vernon [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 26, 2002 2:07 PM
To: inFusion Support List
Subject: [iMS] HTML Message --> Text MessageHi all,Does anyone have a good way to automatically convert/parse the HTML content for the HTML side of the message to use on the Text side?Right now I'm doing a LOT of replace() and it's getting ridiculous...Thanks, Bill----
317.423.3568
William Vernon Omega Design Studio, Inc.
President 18 North Belmont Ave., Suite 16
Indianapolis, IN 46222
This list server is Powered by iMS
"The Swiss Army Knife of Mail Servers"
To leave this list please complete the form at http://www.coolfusion.com/iMSSupport.cfm
Need an iMS Developer license? Sign up for a free license here: http://www.coolfusion.com/iMSDevelopers.cfm
List archives: http://www.mail-archive.com/infusion-email%40eoscape.com/
Note: You are subscribed as [email protected]
- RE: [iMS] HTML Message --> Text Message Marc Lichtenfeld
- RE: [iMS] HTML Message --> Text Message William Vernon
- [iMS] large log files Jose Gosende
- Re: [iMS] large log files Howie Hamlin
- RE: [iMS] large log files Jose Gosende
- RE: [iMS] large log files Justin MacCarthy
- Marc Lichtenfeld
Reply via email to
