Print Topic

Computer Q&A Board  /  Internet  /  Codes in emails
Posted by: alanturk, September 21st, 2007, 3:33pm
I occasionally receive emails containing what I imagine to be HTML codes, such as these:

<html><div style='background-color:'><DIV class=RTE>
<DIV class=RTE>HOORAH!&nbsp;&nbsp;I AM HERE!&nbsp;&nbsp;MY TRIP HAS FINALLY BEGUN!</DIV>
<DIV class=RTE>WOW!

The text of the message is visible in amongst it all, but quite tricky to read. Is there a way of extracting the text to make it readable? I can guess at some of it, but I don't fancy ploughing through a long message, using Word for example, to see what it is all about!
Posted by: Ray, September 22nd, 2007, 8:29pm; Reply: 1
   Yes, it is HTML.
   My suggestion as to how to view it would be to right click on the text of the message, click on Select All from the popup menu.  Then right click again on it and select Copy from the popup menu.
   Open Notepad (or any other text editor) and select Paste from the Edit menu.  This will put all of the email text in Notepad.  Now save the file and give it a filename that ends with .htm
   Go to where you saved it and double click on the file.
Posted by: alanturk, September 23rd, 2007, 3:20pm; Reply: 2
Ray, many thanks for that. It more-or-less worked! When I did what you described I wound up with a .htm document containing a lot of stuff at the start, which was the addresses that it had been sent to (included in the email for some unknown reason) and some more stuff at the end, which was related to the fact that it had come via Hotmail. I did a further copy and paste operation into Word, then deleted the beginning and end bits, which left me with the text in a much more readable form, but interspersed with "\line" at intervals. These I removed with Word's search and replace function (i.e. replaced them all with nothing) and finally saved the whole thing as a Word document that I could have printed, had I wanted to. A bit of a business to achieve it, but better than individually deleting all the bits of HTML code. Unless anyone has a better idea, that's what I'll do in future if I get any more like that.

In passing, I wonder how it came to be like that in the first place. I get plenty of emails via Hotmail, but the others appear as quite normal, so Hotmail itself clearly isn't the problem. Any ideas?

Thanks again.
Posted by: dlwolff0, September 25th, 2007, 11:47pm; Reply: 3
If the first post html example is complete, it didn't show up correctly because the author omitted the end code </html>.
Without the end code, the browser did not recognize the message as html, so it didn't display it as such.
The initial code <html> told the browser to prepare to display the message as html, but without the end code it didn't know what part to use, so it just displayed regular text for the entire message. That's why all the coding showed up.
Just a slip up by whoever coded it.
Posted by: alanturk, October 1st, 2007, 7:26pm; Reply: 4
Thanks for the comment. Actually I just pasted in a bit of the original email, which was quite long and contained personal stuff that I didn't want to broadcast. It was just intended to show an example of the sort of thing I had received. I don't know now whether the end code was present or not, but I'll look it up sometime.
Print page generated: December 4th, 2008, 6:01am