GetMail: HTML emails are empty

Having some problems where the incoming email is pure HTML - ie Newsletters.

Have two fields but on some emails they are both blank:

  • forms.wx_documents.detail = msg.getPlainMsg()
  • forms.wx_documents.detail_html = msg.getHtmlMsg()

Following is part of raw text from Microsoft Partner Program newsletter that formats/displays OK in other email clients but is completely blank in Servoy.

a {color : #0033CC;} a:link {color: #0033CC;} a:visited.local {color: #0033CC;} a:visited {color : #800080;}


Can anyone provide some guidance on how to trap for or somehow display these messages? Thanks in advance.

Graham Greensall
Worxinfo Ltd

My tests show that removing the following line makes things display again.

<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

Hope this helps.

Thanks for tip Robert, but still not rendering. However pasted into Dreamweaver and didn’t render very well in there either!!

In short term will trap for “<META http” and warn clients that content probably missing.

Regards

Graham Greensall
Worxinfo Ltd

Hi Graham,

In the existing code:

<html xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:user="http://mycompany.com/mynamespace">
<head>

<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

DO remove the entire “meta” line - AND change the line:

<html xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:user="http://mycompany.com/mynamespace">

To just plain: “”

Hope this helps.

Hi Bob

Thats a REALLY good suggestion. THANKYOU :D

But I guess it’s going to be difficult to code these changes as I assume these extra parts of the header will vary depending on how the Sender writes the code.

My Client accepts that they not missing much at moment since pure HTML emails tend to be newsletters or spam - however they are concerned that some useful info from their clients/suppliers may be lost in the future.

Maybe an opportunity for one of our resident Plugin aces ???

Thanks again

Graham Greensall
Worxinfo Ltd

Hi Graham,

Does the HTML render with the plain ?
In my test it did render with the MS HTML tag as long as the META tag was removed.

I did my test on Servoy Developer
Version R2 2.2.1-build 333
Java version 1.4.2-54 (Mac OS X)

As for automatically removing the tags.
You could use regex (regular expressions) to remove the META and replace the HTML tag. You could even do it for displaying purposes only like with a calculation field. This way you keep the original data.

Just some thoughts.

I can confirm Bob’s suggestion.
I remember having same problem solved, by removing meta tag and and cleaning up html tag.

Thanks Robert

No, the MS Developers message it did not display with just - however I now suspect that it may have been due to other playing/testing I had been doing. Will look at it again later with yours & Bobs suggestions.

Regex - another dark corner of Servoy that I’ve managed to avoid so far :oops: Looks like now’s the time to get my hands dirty.

Graham Greensall
Worxinfo Ltd

Graham,

Did you manage to code for the changes just ot using REGEX. If so could you share you solution?

Thanks

MerMer