Quantcast
Channel: ImapX 2
Viewing all articles
Browse latest Browse all 1952

New Post: Need help, retrieving decoded message body

$
0
0
Hi Vnwind,

First of all, we should make clear how you want to store and read back the messages including attachments. If you took a look at the sample application, you saw that it is displaying the message body returned by the GetDecodedBody method in a WebBrowser control. The attachments and the inline attachments (e.g images in messages) are cached on disk.

In general you have two options:
  1. You store the information of your message in the database, such fields as Sender, Recipient, Date, Subject and the decoded body (use GetDecodedBody method). At same time you have a table with information on attachments, including the file name, file type, file encoding and the binary data. (You can get this all from the Attachments/InlineAttachments collection) of a message.
  2. Second option differs only in the way you save the attachments. You can cache the attachments to disk and save only the path information in database.
Personally I prefer the second option.

After you saved the messages this way, you can just do same as in the sample application: read the data from the database, and display the saved decoded body in a WebBrowser control, and bind the attachments.

Hope could help you with the idea.

When I have more time I'll extend the sample application with the option on storing messages into a database.


Greets,

Pavel

Viewing all articles
Browse latest Browse all 1952

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>