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:
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
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:
-
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.
-
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.
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