Rebuilding email from database

C

chazmanian

We have a third-party application that enables saving emails and attachments
into a SQL Server database as image datatypes. For reasons of our own, we
want to be able to retrieve this data.

We are able to (via C# and ADO.Net) read this data and save it to disk - in
effect, "reconstituting" the email and its attachments. We save the email
data as a ".msg" file and double-clicking it allows Outlook to open it. So
far, so good. The trouble begins when we attempt to open an attachment
associated with the email using the email window. Double-clicking the
attachment instead causes an Outlook dialog to appear stating "Not found".

Is there any way to store the ".msg" file and the associated attachments
such that double-clicking the attachment from the opened email message will
allow the attachment file to open? Is there some special directory that these
files have to be stored in?

Any help would be appreciated. Thanks.
 
F

F.H. Muffman

We have a third-party application that enables saving emails and
attachments into a SQL Server database as image datatypes. For reasons
of our own, we want to be able to retrieve this data.

We are able to (via C# and ADO.Net) read this data and save it to disk
- in effect, "reconstituting" the email and its attachments. We save
the email data as a ".msg" file and double-clicking it allows Outlook
to open it. So far, so good. The trouble begins when we attempt to
open an attachment associated with the email using the email window.
Double-clicking the attachment instead causes an Outlook dialog to
appear stating "Not found".

Is there any way to store the ".msg" file and the associated
attachments such that double-clicking the attachment from the opened
email message will allow the attachment file to open?

Well, if you drag a message with an attachment out of Outlook and put it
on the hard drive, and then double click that msg file, can you access the
attachment?

My initial thought is that, assuming you can actually access the attachments
directly from the database and successfully open them, when you are 'reconstituing'
the message, you aren't being very successful with pulling out the attachment.
Honestly, you might have a quicker solution building a UI that simply accesses
the data directly out of the SQL server.
Is there some
special directory that these files have to be stored in?

Which files? The attachments? The attachments are part of the MSG file.
I'd wager they are MIME encoded, but that's just a guess. I'd try this.
I'd take an email out of Outlook, drop it on the hard drive, let the third
party app save it to the sql database, and then use your app to pull it back
out and then compare the two files, the one dropped out of Outlook and the
one you're creating. I'm not entirely sure that the MSG file structure is
a publically defined structure, but, if it is, you'll probably have some
luck looking at MSDN and posting to microsoft.public.outlook.program_addins
asking about creating a MSG file based on a text file and a binary attachment.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top