Search code examples
mysqlvbaoutlookmysql-workbench

Integration between MS Outlook and MySQL


is there any way to connect/Integrate MS Outlook folders to MYSQL single table including Outlook inbox, sent items and if any other folders created by users.

Single Table Format:

|Id|Folder Path|Subject|DisplayTo|DisplayCc|DateTimeSent|DateTimeReceived|IsRead|HasAttachments|Preview|

Below are requirements:

  1. Configure MS Outlook with MySQL
  2. New incoming mail comes to inbox it should get triggered to MySQL table with above format
  3. whenever outgoing mail goes to it should get triggered to MySQL table with above format
  4. connection should check every 60 seconds/ possible intervals

These are tools involved with this project MS Access as front end application, MYSQL as Database and MS outlook as data source.

Thanks in advance!!


Solution

  • It seems you need to develop an add-in for Outlook to have a corresponding MySQL db filled with Outlook data. See Walkthrough: Create your first VSTO Add-in for Outlook for more information.

    There are two core events you need to handle to cover incoming and outgoing emails:

    • The NewMailEx event fires when a new message arrives in the Inbox and before client rule processing occurs. You can use the Entry ID returned in the EntryIDCollection array to call the NameSpace.GetItemFromID method and process the item.
    • The ItemSend event is fired whenever an Microsoft Outlook item is sent, either by the user through an Inspector (before the inspector is closed, but after the user clicks the Send button) or when the Send method for an Outlook item, such as MailItem, is used in a program.