Reading MIME messages

I’ve got C API code that reads mail messages.HTML type messages seem to have multiple “Body”

items containing the MIME message parts. What API call do I make to retrieve these parts?

Also, in one of the examples there is an

embedded jpg, but it does not show up when I call MailGetMessageAttachmentInfo. Does anyone

know how to do either of these tasks?

Subject: Reading MIME messages

You have a number of different tasks, if you really want to do this from the C API, but much of it can now be done using LotusScript classes. It’s your call.

As for your questions (my responses in this color)

I’ve got C API code that reads mail messages. Presumably rich text messages.

HTML type messages seem to have multiple “Body”

items containing the MIME message parts. What API call do I make to retrieve these parts? A series of calls starting with NSFItemInfo and subsequent calls to NSFItemInfoNext. Each of these Body items is a MIME part, so you need to use the structures in the MIMEODS.h file to understand the data.

Also, in one of the examples there is an

embedded jpg, but it does not show up when I call MailGetMessageAttachmentInfo. Images “embedded” in MIME are BASE64 encoded and stored as parts, so MailGetMessageAttachmentInfo won’t find them. Does anyone

know how to do either of these tasks?:

A cheap way may be to convert from MIME to rich text and then use the code you have, but any images which are not embedded but are accessed through URL will likely be lost. You can convert simply by opening without setting the OPEN_RAW_MIME (or something like that) flag.

Subject: RE: Reading MIME messages

I’ve tried to use NSFItemInfo and NSFItemInfoNext to retrieve the item “Body”.When I look at a sample message using the Notes

client, it tells me there are 4 “Body” items.

When I use the above API calls, it tells me

there is only 1. Another example shows 7 “Body” items via the client, but the API calls say there are 22. The API calls are confirmed by NSFItemScan. Why the difference?

Subject: RE: Reading MIME messages

The Notes client does a conversion from rich text to MIME. A four part MIME message might be 1) Prolog

  1. HTML Part

  2. Plain Text part

  3. Epilog

If there were graphics or attachments, there would be more, perhaps many more. The rich text fields are different, as they break up based on size rather than by part types, so twenty two MIME parts could easily be seven rich text parts, or one, or even 22+.