Solved

Sync Outlook mail in .NET CRM application

Posted on 2011-09-12
12
397 Views
Last Modified: 2012-05-12
I am developing a CRM application which follows the typical Company > Contact system.

Every Client's contact have email addresses stored.

Now, users send emails to contacts via Outlook(sometimes Exchange server or sometimes just as a mail client for google Apps...)

What I want to be able to do is to track all these emails within the CRM.

For example when users are browsing client records, they should be able to see all the emails sent/received between users in the company and clients.

What are my options?

From my limited knowledge I am guessing that when a user is logged on I query the user's mailbox and save mails to database.

I am not sure whether to use MAPI or System.Net.Mail.

Any suggestions, links etc would be highly appreciated.
0
Comment
Question by:isaackhazi
  • 7
  • 5
12 Comments
 
LVL 11

Expert Comment

by:DavidT543
ID: 36527731
I have written such a CRM system.

I use MAPI and Redemption to access the emails.

You need to monitor the sent items and inbox for new and existing messages.
Each message you look at the recipients collection and for each recipient you extract the email address.

You can either do this as an Outlook addin - or you can log on directly to the exchange server via MAPI or web services and query the users maillbox from there. The former is easier to set up as permissions are all in place. THe latter requires you to use an account with permissions like Balckberry server (BIS) to access all the mailboxes.
0
 
LVL 8

Author Comment

by:isaackhazi
ID: 36528019
I would want to implement the first system as sometimes the mail server is not exchange and it could at times be Google Apps, so I would prefer to read emails from outlook rather than from the server.

So, once we get emails from the users outlook mail store, should I save the msg to disk and store it in the database. Is that the right way to do it?
0
 
LVL 8

Author Comment

by:isaackhazi
ID: 36528056
I would be greatful if you Could you provide me some code samples or links that would help me get started as I have never worked with MAPI objects or redemption before.

0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 11

Expert Comment

by:DavidT543
ID: 36528060
There are lots of ways to do this. A lot depends on how you want to display the information to users.

I would read the message body and store that. It could be in plain text - or in HTML so you will need to review that.

What database are you going to use? How will users access the database?

If you want to see how I implemented it - you can look at http://www.davton.com/crm.html
0
 
LVL 11

Expert Comment

by:DavidT543
ID: 36528087
You are on a very steep learning curve with Outlook and MAPI.

I suggest you start with the Outlook Code web site. It has lots of code samples.
http://www.outlookcode.com/article.aspx?ID=37

There are two books which i have found invaluable:

Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators
by Sue Mosher

Professional Outlook 2007 Programming
by Ken Slovak
0
 
LVL 11

Expert Comment

by:DavidT543
ID: 36528090
The redemption software provides ways to do stuff you can't do in the Outlook object model - and at much faster speeds.

http://www.dimastr.com/redemption/

0
 
LVL 11

Assisted Solution

by:DavidT543
DavidT543 earned 500 total points
ID: 36528101
by the way with redemption its the RDO family of objects you want to work with. They will give you access to folders, item collections, emails, email body, recipient collections etc
0
 
LVL 8

Author Comment

by:isaackhazi
ID: 36528183
Ideally I would want to save the entire message msg format into database.
I am using SQl server 2008 R2.

It is a recruitment CRM system that tracks applicants and this will be one part/feature of this applicant tracking system where emails sent/received to applicants or clients will be tracked and stored in the database.

Users will see all messages associated with the applicant or client when they view the applicant /client profile ....

This is the idea....
0
 
LVL 8

Author Comment

by:isaackhazi
ID: 36528198
I have checked your implementation and it seems you have integrated the CRM into Outlook.

All I need is to save message files from inbox/sent items to database.

These messages will be displayed (in a simple grid) in the CRm application which is a standalone app.

on clicking the message I will write the msg file to disk and open it in the default mail client(Outlook).

0
 
LVL 11

Accepted Solution

by:
DavidT543 earned 500 total points
ID: 36528277
If you look at how HighRise do their CRM- they have an email address which you can use to bcc mails that get sent and received if you want them to add to the system. Would that work for you?

http://highrisehq.com/tour#email
0
 
LVL 8

Author Comment

by:isaackhazi
ID: 36528294
I guess it would be best for me to see if my approach is right. I guess you would be the best person to advice me.

I have a table with all Applicants (50k)
I have another table with contacts(2-3K)


When a user logins into the CRM.
I authenticate based on the default mail profile on the system.
Search the Inbox/Sent items to see if to/from address matches the emails in my 2 tables mentioned above...

If it does write message to file and save to database,...

This way all user mail will be saved to DB and can be viewed by all users..

Is this approach correct?
0
 
LVL 11

Assisted Solution

by:DavidT543
DavidT543 earned 500 total points
ID: 36528394
There is not one approach that is 'correct'. Your method sounds like it will work.
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question