Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Insert SQL Query upon receiving mail in mailbox

Posted on 2013-11-23
8
Medium Priority
?
9,556 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
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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

Stellar Exchange Toolkit: this 5 in 1 toolkit comes loaded with mega-software tool. Here’s an introduction to tools’ usage and advantages:
Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
This video discusses moving either the default database or any database to a new volume.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Suggested Courses

926 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