Watch Emails?

Started by MW4, June 21, 2017, 12:51:43 PM

Previous topic - Next topic

MW4

Does anyone know if there is code out there or if it's possible to "Watch" an email account (Outlook 365) and then do something, like the "Watch Folder then do something' code does?

I have datasets that come via e-mail and I'd like to program it out to run an SSIS script in order to append the new data to our SQL server table.

A point in the right direction would be appreciated.

td

Don't know of any example scripts but COM events using the Outlook email client object "Outlook.Application" is one possibility with WinBatch.  Of course you would need to have Outlook installed to use it.  The object has several events, like "NewMail" that could trigger another  script based on source or subject or something.   I have not tried  it so can't promise it will work, however.   Other standalone email clients allow you to setup triggers based on incoming email  and take some action like execute a script or program. 

There is always writing your own mini-client using the WinSock extender but that is likely more work than it is worth.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

JTaylor

Not sure if it is what you are wanting but I have, upon occasion, written scripts that check an email account and take action using the POSTIE Extender.  One is a registration process which takes the data and writes to a database.   Did that when I didn't have a good secure option on my web server.   Not that email is all that secure but better than what I had at the time.

Have another app somewhere that was designed to check an account and then take a specified action such as run an exe or such things.  Haven't looked at that one in years though.

I realize that without giving you code it isn't overly helpful but it wouldn't be that much different than what you will find as examples in the POSTIE Help file.   Once you have the message the rest would be specific to your task anyway.   If you really need an example I can see what I can track down but would suggest starting with the POSTIE Help file first.

Jim

MW4

JTaylor,
I'll get digging in on the postie, but if you could find that app, that would be worth looking at as well.

You'd think MSSQL would have something natively...


Thanks!!

JTaylor

I think you can send mail through MSSQL (remember reading something years ago) but that doesn't help, of course.

Jim

td

Quote from: MW4 on June 21, 2017, 03:07:22 PM
JTaylor,
I'll get digging in on the postie, but if you could find that app, that would be worth looking at as well.


Take a look at the kGetMail function in the WIL Consolidated Help file - assuming you have the Postie extender installed.  The function's 'pat' parameter allows you to retrieve email with  specific  subject line content.  You can also use the function to delete messages so that you don't retrieve them again the next time you check for a specific subject line. 
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

JTaylor

Hopefully you are making progress...I am moving in three days and am in full packing mode and my wife thinks that is more important :)    Happy to help further but will be a few days.

Jim