Login to participate
  
       
Register   Lost ID/password?
Louis Kessler’s Behold Blog » Blog Entry           prev Prev   Next next

Html2Text - Wed, 17 Mar 2010

A good way to set up an e-mail newsletter is to use html formatting. Html is formatting to look more like web pages and you can make a very nicely designed newsletter with it. The unfortunate problem with that is many people turn it off or have it turned off, sometimes for security issues.

When html e-mail is turned off, the person sees the e-mail as text only. No images will show. No formatting will be done. And the textual parts of the newsletters are usually translated by most e-mail programs into text that is formatted in a very ugly manner.

Well I don’t want my newsletters to look like that. The solution is to send both an html and a text version of the newsletter in the one e-mail. That is a standard way of making sure that both ways of viewing the e-mail will have it look good.

Of course, I don’t want to write two versions of each newsletter, so I need an automated way of pulling the text out of my html and formatting it nicely.

Unfortunately my Simple PHP Newsletter System did not include an automatic Html to Text conversion in it.

Fortunately, there was one in PHPlist.

Unfortunately, it did not produce results looking as nice as I wanted it to.

Fortunately, the code was not very long and I could probably customize it.

Unfortunately, it was using Regular Expressions which are a beast to work with and would take me a week to get good at.

Fortunately, there were other Html2Text routines on the web, and I found and implemented a pretty good one.

So now its up to 3 weeks for the Newsletter system. We’ll see if I can send it out by the weekend.

No Comments Yet

Leave a Comment

You must login to comment.

Login to participate
  
       
Register   Lost ID/password?