viewing mime email (or better yet, a full-blown IMAP client!)

  1. 3 weeks ago

    Seth O

    May 8 Pre-Release Testers, Xojo Pro Florida/England/California/NY/...

    Is anyone aware of a product (with source) or sample code for reliably displaying the content of MIME email, possibly via an HTMLviewer (so that it would also work in a web app)?

    I have code that seems to work for pulling down email via IMAP and displaying simple text or HTML messages, but it's ugly and complex and still fails to display more messages than it works with...

    Ideally, I'd love to find a fully function email client built in Xojo that downloads email to a local DB and also allows sending...

    Christian, I was finally able to test out the Email Viewer sample project that's included with the MBS plugins and based on my preliminary testing, it looks like it works fine for parsing out MIME messages for display and downloading of attachments. I still haven't (yet) done hard-core testing of complex attachment names that Beatrix mentioned, but so far so good!

    Basically, what I'm doing at the moment is downloading email from Office365 via IMAP using the MBS CURLS plugin, save it in an SQL database to keep it local so that each message never needs to be pulled more than once. The list of messages is presented to the user and when they select one, it is displayed in an HTMLViewer after being parsed using MimeEmailMBS.

    So far, so good! Thanks all!

  2. nicolás c

    May 8 Pre-Release Testers, Xojo Pro argentina

    did you try mbs plugins?

  3. Seth O

    May 8 Pre-Release Testers, Xojo Pro Florida/England/California/NY/...

    I have the MBS plugins and use them for a lot of things--but unless I overlooked something (which is very possible given how little sleep I'm running on right now!), there's not something there that can act as MIME mail viewer in a web app running on a Windows server? Maybe in a native Windows app?

  4. Oliver O

    May 8 Pre-Release Testers, Xojo Pro https://seminar.pro

    If anyone knows then @Beatrix W - she is THE email-guru here

  5. Tobias B

    May 8 Pre-Release Testers, Xojo Pro Bern, Switzerland

    In addition to what was already suggested, here are some more links that might help as a starting point for you:

  6. Christian S

    May 8 Pre-Release Testers, Xojo Pro, XDC Speakers Germany
    Edited 3 weeks ago

    MBS Plugin has curl functions for IMAP and to parse the emails. You could try examples.

  7. Seth O

    May 8 Pre-Release Testers, Xojo Pro Florida/England/California/NY/...

    I'm using MBS Curl for pulling messages down via IMAP--it's just displaying them cleanly that I'm having problems with (all the various MIME parts and attachments). Christian, what do you mean by "parsely NUG emails?"

  8. Christian S

    May 8 Pre-Release Testers, Xojo Pro, XDC Speakers Germany

    Here are the email parser classes:

    http://www.monkeybreadsoftware.net/pluginpart-emailparser.shtml

    incorrect spellchecking correction fixed.

  9. Beatrix W

    May 8 Pre-Release Testers Europe (Germany)

    Parsing emails is a lot of interpretation. The Chilkat plugin has a method to parse the simpler mails but this fails as soon are you get multipart emails. I haven't looked at the CURL plugin from MBS in depth. A spot check showed that it couldn't parse the more complicated attachment names a while ago. IMO the only option for commercial software is the Chilkat plugin.

    I have a home grown parser that catches most of the more complex stuff. I need to redo this with the Chilkat plugin in the next months. Wanted to make this open-source. But I need to finish the 64bit version of my software first.

  10. Seth O

    May 8 Pre-Release Testers, Xojo Pro Florida/England/California/NY/...

    Beatrix, you said "...the only option for commercial software is the Chilkat plugin" right after you say "The Chilkat plugin...fails as soon as you get multipart emails." Those two statements seem contradictory to me? Also, can you give an example of "complicated attachment names" that cause problems for MBS? I'm dealing primarily with multi-part emails (lots of attachments and embedded images and stuff, so it sounds like neither plugin will be smooth sailing :(

    Christian, thanks for the link--I had overlooked some of those functions and the sample Email Viewer, so I look forward to trying them out tomorrow!

  11. Beatrix W

    May 9 Pre-Release Testers Europe (Germany)

    There is a function in the Chilkat plugin for parsing messages. This got me about 90% of my test mails with simple structures. There are more functions to take the message apart and iterate through the parts. Which is quite a bit of work to get right.

    I'm not at home so I don't have the code in front of me. You can have attachment names in multiple rows like:

    attachmentsomething
    continuation character + attachment end

    Combine this with encoding in the form of ?utf8? and you can get pretty complex stuff. As far as I remember the CURL stuff didn't support this at all.

  12. 2 weeks ago

    Seth O

    May 14 Pre-Release Testers, Xojo Pro Answer Florida/England/California/NY/...

    Christian, I was finally able to test out the Email Viewer sample project that's included with the MBS plugins and based on my preliminary testing, it looks like it works fine for parsing out MIME messages for display and downloading of attachments. I still haven't (yet) done hard-core testing of complex attachment names that Beatrix mentioned, but so far so good!

    Basically, what I'm doing at the moment is downloading email from Office365 via IMAP using the MBS CURLS plugin, save it in an SQL database to keep it local so that each message never needs to be pulled more than once. The list of messages is presented to the user and when they select one, it is displayed in an HTMLViewer after being parsed using MimeEmailMBS.

    So far, so good! Thanks all!

  13. Beatrix W

    May 15 Pre-Release Testers Europe (Germany)

    I wanted to give you the example for the attachment name:

    Content-Transfer-Encoding: base64
    Content-Type: application/octet-stream;
    name*0="=?UTF-8?B?UHJvZHVrdGJlc2NocmVpYnVuZyBCSE0gw5xiZXJkYWNodW5nc3N5c3"
    name*1="RlbWUgRGFjaCAmIEdyw7xuZGFjaCAwOS5wZGY=?=";
    Content-Disposition: attachment;
    filename*0="=?UTF-8?B?UHJvZHVrdGJlc2NocmVpYnVuZyBCSE0gw5xiZXJkYWNodW5nc3"
    filename*1="N5c3RlbWUgRGFjaCAmIEdyw7xuZGFjaCAwOS5wZGY=?=";

    That is german. I really would be interested if CURL can parse this.

  14. shao s

    May 15 Pre-Release Testers Sudbury, Ontario, Canada

    What program gives that output?

  15. Beatrix W

    May 15 Pre-Release Testers Europe (Germany)

    This is raw data from an example mail with the most complicated encoding I know about. Funnily it was a mail to me. It's base64 encoded UTF8 data concatenated together.

  16. shao s

    May 16 Pre-Release Testers Sudbury, Ontario, Canada

    I've never seen concatenated headers like that, kinda neat, kinda scary ;-)

or Sign Up to reply!