Click here to Skip to main content
11,642,402 members (63,952 online)
Click here to Skip to main content

Backing up MS Outlook emails along with Meta-data

, 4 Jun 2006 43.8K 699 38
Rate this:
Please Sign up or sign in to vote.
Scans outlook inbox folder and put emails information in database. Also creates .msg file fore every message in Emails Folder. Finally it moves Email from inbox to inboxBackupFolder.

Sample screenshot Download sourcecode (804 kb)

Sample screenshot

Introduction

Outlook Logger is a console base application that scans your MS Outlook Inbox folder and saves the meta-data of your emails in MS Access database For Example: sender information, Email Subject, Attachments Count, Message sent and Receive time, Message Importance etc. Further it also saves the TO,CC,BCC information for each email in another table.

Application creates an outlook .msg and save i Emails directory. Emails are saved in sub-folders named as recieved date of emails.

Finally it moves Email from inbox to "Personal Folders\InBoxBackup" Folder.

Outlook Redemption has been used to get rid of Security Prompts in  outlook.

Not a tough thing to do!! So move on...

Note: Following Steps to run application
---------------------------------------
1. Register redemption.dll (provided with code) using regsvr32 on your Computer.
2. Create Personal Folders\InBoxBackup Folder in outlook

 

Database Side:

Outlook logger stores the meta-data of emails in 'OutLook_DB.mdb' database that is located in \bin folder. Database contains the following four tables.

1) 'Outlook_logger_tmp' : Temporary Storage of EntryID of all emails in inbox.
2) 'Outlook_logger_message': Store Emails Meta-data as described above.
3) 'Outlook_logger_Recipients': Stores the information of Emails Recipients, as To,Bcc and CC.
4) 'Outlook_logger_Attachments': Attachments data of emails

EntryID is the property of Outlook that uniquely identifies each email (in a folder). I have appended sender email address to apply more uniqueness for example:

0000000094991EDBACA62B41A7E88CDEC57A942824002000-sajid.mahmood@hotmail

Every Email has its own ID and tracked against it. Linked in tables and also the .msg file name.

Functionality
a. NEW EMAILS IDENTIFICATION
-------------------------------
 a) Delete All Recs from outlook_logger_tmp table.
 b) Get EntryID for each email from Inbox in 'Outlook_logger_tmp'.
 c) Compare EntryIDs in outlook_logger_tmp with 'Outlook_logger_message' table and identify New Emails (EntryIDs).
 d) Save new EntryIDs in an ArrayList.

b. Start Processing each Email one by one
----------------------------------------------
 a) Save Emails Meta-deta in outlook_logger_message table.
 a) Save To,CC,BCC to 'OUTLOOK_LOGGER_RECIPIENTS' table.
 b) Check if attachment then save the attachment metadata in 'OUTLOOK_LOGGER_ATTACHMENTS'.
 c) Save Email File
 d) Move Email in backup folder

Lets jump into source Code:

<FONT color=#0000ff></FONT>
<FONT color=#0000ff>

Sub</FONT>
 <FONT size=2><P></FONT>
<P><FONT color=#0000ff size=2></FONT>
</FONT>
<P><FONT color=#0000ff size=2> </P>
<P><FONT color=#0000ff size=2> </P>
</FONT>

Conclusion

Main theme behind writing this article was to develop an understanding of working with MS Outlook in .Net and use of Outlook Redemption to get rid of security prompts in Outlook, when emails are accessed outside MS-Outook (with service pack installed).

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

Ehsan Abbasi
Web Developer
Pakistan Pakistan
Author has Master's degree in Computer Science. Worked in VC++ earlier. Now working in .Net technologies.

Some Experience in Multimedia and E-Learning as well. Now a days he is developing software applications for Telecom and mobile sector.

You may also be interested in...

Comments and Discussions

 
Questionsource code print corrupted Pin
hjgode15-Aug-14 19:53
memberhjgode15-Aug-14 19:53 
Generalhiiiiiiii Pin
sunny12nov19854-Feb-11 19:15
membersunny12nov19854-Feb-11 19:15 
GeneralMy vote of 5 Pin
treesprite29-Jan-11 5:35
membertreesprite29-Jan-11 5:35 
GeneralThank you Pin
rtchandler252-Dec-09 9:41
memberrtchandler252-Dec-09 9:41 
GeneralC++ Pin
MPTP18-Jun-09 18:57
memberMPTP18-Jun-09 18:57 
GeneralThank you very much~! Pin
cotopboy Zhang17-Dec-08 5:29
membercotopboy Zhang17-Dec-08 5:29 
GeneralExcellent Pin
profpaul22-Mar-07 14:23
memberprofpaul22-Mar-07 14:23 
GeneralDatabase script Pin
skirby5531-May-06 9:55
memberskirby5531-May-06 9:55 
GeneralRe: Database script Pin
Ehsan Abbasi4-Jun-06 20:24
memberEhsan Abbasi4-Jun-06 20:24 
GeneralRe: Database script Pin
skirby555-Jun-06 4:15
memberskirby555-Jun-06 4:15 
Generalwaste of space Pin
Darka26-May-06 5:25
memberDarka26-May-06 5:25 
GeneralRe: waste of space Pin
Ehsan Abbasi28-May-06 19:36
memberEhsan Abbasi28-May-06 19:36 
GeneralRe: waste of space Pin
priestnall31-Aug-09 21:43
memberpriestnall31-Aug-09 21:43 
GeneralRe: waste of space Pin
Jonathan [Darka]31-Aug-09 22:01
memberJonathan [Darka]31-Aug-09 22:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.150731.1 | Last Updated 5 Jun 2006
Article Copyright 2006 by Ehsan Abbasi
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid