Solved

Insert SQL Query upon receiving mail in mailbox

Posted on 2013-11-23
8
8,764 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 250 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 250 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

Free eBook: Backup on AWS

Everything you need to know about backup and disaster recovery with AWS, for FREE!

Question has a verified solution.

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

Suggested Solutions

This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
After hours on line I found a solution which pointed to the inherited Active Directory permissions . You have to give/allow permissions to the "Exchange trusted subsystem" for the user in the Active Directory...
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…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

759 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