Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Insert SQL Query upon receiving mail in mailbox

Posted on 2013-11-23
8
Medium Priority
?
9,333 Views
Last Modified: 2016-02-11
Team - may be a dumb question / difficult one.

I have a mailbox. Lets say "CorporateMailbox". What I need is, Whenever any user sends an email with the subject line "123456 1x1 completed for 987654", I need to auto-write an sql query to a table which will say, Insert into 1on1table (Submitternt, Submitterid, type, status, Employeeid) values ("Senders' mail id without "@abc.com", "123456", "1x1", "completed", "987654")

Can someone guide me on these lines please?

intent is to have the query done for multiple activities/ type like 1x1, Performance improvement plan etc., but the insert query have to happen live. that is, if i send an email to the mailbox with correct subject line, query should run immediately, else, an auto email should trigger to the sender with correct subject line format.

Please help
0
Comment
Question by:Manju
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 6

Author Comment

by:Manju
ID: 39671616
btw, i found this article. http://msdn.microsoft.com/en-us/magazine/cc301799.aspx 

Will this suffice? do i need to be an admin or something? where can i store n run the macro?
0
 
LVL 28

Assisted Solution

by:Ryan McCauley
Ryan McCauley earned 1000 total points
ID: 39672244
I've done macros in Outlook before and you don't need to be a local administrator to implement them - you're just restricted to activities your user can normally do. In this case, as long as your Windows user can perform those database inserts (or you have the SQL login for a user that can), you can write a VBA macro in Outlook to do whatever you want when you receive a message. In my case,

The walk-through you linked is a great starting point - it's pretty thorough and covers everything you'd need to know to set this up. If you have specific questions about the implementation, feel free to post them and the community can help, but you're definitely on the right track.
0
 
LVL 15

Expert Comment

by:jorge_toriz
ID: 39672296
Mmm... you can create a POP3 client and check the inbox each 30 seconds and discard the emails already processed.

Its a quite simple to create a POP3 client, just:
1. USER
2. PASS
3. LIST
4. RETR
0
 
LVL 51

Accepted Solution

by:
Mark Wills earned 1000 total points
ID: 39672342
It is a good article, and is on the right path.

You can also use SQL Server, there are routines to get mail, process mail etc... http://technet.microsoft.com/en-us/library/ms179879(v=sql.105).aspx

But those are deprecated in sql2012, and have to use DBmail instead.

Then, you could always do what I did (and I am handy with SQL and can write macros) and use a third part tool such as : http://www.geniusconnect.com/ (which is the one I have used) or http://www.email2db.com/ (which has also been recommended but a lot more expensive).

For the $100 geniusconnect business version (for me) it did everything I needed and was not all that different to your requirement.

So, three choices for you...

1) From Outlook push to SQL (ie the Article)
2) From SQL Server pull from Outlook (fair bit of set up, but good examples around)
3) Third Party tool (probably the easiest, but costs)
0
 
LVL 6

Author Closing Comment

by:Manju
ID: 39673143
Thanks Ryan & Mark
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

A couple of months ago we ran into an issue that necessitated re-creating our Edge Subscriptions. However, when we attempted to execute the command: New-EdgeSubscription -filename C:\NewEdgeSub_01.xml we received an error indicating that the LDAP se…
How to deal with a specific error when using the Enable-RemoteMailbox cmdlet to create a mailbox in the cloud-based service, for an existing user in an on-premises Active Directory.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

670 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