Outlook Inbox to SQL Server ( or SharePoint, Access)

Hi All

I have a business unit that receives emails in Outlook in a specific address, and has a need to enter into a database table (preferably SQL Server, maybe Access or SharePoint if that's not possible) columns such as From/Subject/Body.  

They are currently manually entering this info in Sharepoint, but we'd prefer an automated process.

Question:  Has anyone created a process that reads Outlook emails and writes to SQL Server?

Note:  Links-only answers will be summarily rejected with childlike glee.

Thanks in advance.
LVL 67
Jim HornMicrosoft SQL Server Data DudeAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Éric MoreauSenior .Net ConsultantCommented:
If you are looking for a ready made solution, good luck.

I have built a couple of these systems getting emails and their attachment and persist them. Usually I use Aspose Emails to get emails and attachments, to move the emails to a processed folder.
Question:  Has anyone created a process that reads Outlook emails and writes to SQL Server?
Nuts & bolts, I've built chunks of it.
You and me are Access guys.
In Access, you get Outlook open as an automation object

Once you have Outlook on the go, you get pointed to the folder in question.
Usually I am looking for the inbox though, but you can get dialog boxes to allow the user to select on the go
Or just use GetFolder("TheFolderName") to point it a at user-named folder

Dim ns As Outlook.Namespace
Dim Folder As Outlook.MAPIFolder
Dim objOutlookMsg As Outlook.MailItem
Set ns = objOutlook.GetNamespace("MAPI")
Set Folder = ns.GetDefaultFolder(olFolderInbox)
Set objOutlookExplorers = objOutlook.Explorers

If wasOpen = False Then
    objOutlookExplorers.Add Folder
    'done opening
End If

Open in new window

from there, it's  for each next loop work.

Dim objOutlookRecip as Outlook.Recipient
Dim MyItems As Outlook.Items
set MyItems = Folder.Items
For each objOutlookMsg in MyItems
    For Each objOutlookRecip.Recipients
          Select Case objOutlookRecip.Type
                Case olTo
                     'recordset work for the To address
                Case olOriginator
                     'recordset work for the From address
                Case olCC
                     'recordset work for the CC address
          End Select
    Next  objOutlookRecip
    'recordset work to send .Subject to a field
    'recordset work to send .Body to a field
Next objOutlookMsg  

Takes a bit to wrap your head around the syntax, but the days of building VBScript in Notepad to automate Outlook are thankfully far behinds us.
omgangIT ManagerCommented:
Jim, clarification please.  All users in the business unit need to do this for email messages received from a particular address
there is one mail box that receives all the email messages and each message needs to be entered into the database

OM Gang
Mohit NairSenior AssociateCommented:
Why don't you send the whole email to SharePoint by configuring incoming mail settings to a library. Just enable this feature into one of the library in SharePoint which will also provide an email address to the library. Forward all the mails to that mail address. It would reach there .

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Jim HornMicrosoft SQL Server Data DudeAuthor Commented:
Hi guys

I just left the gig where this was in play, and it's not actionable to me anymore, so I'm going to share the wealth and close the question.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.