Sending an Outlook E-Mail with voting options via a batch file

Is it possible to use a batch file to send an Email from Outlook 2007?  We need to make use of Outlook's Voting Buttons and cannot simply use an SMTP server to send the mail.  It must be sent through the Outlook application itself.  

Our goal is to have a watch on a drop folder which executes the batch file when a file is placed in the folder.  The batch file will parse the dropped file and send it off through Outook.  Is this possible with any of Outlooks command line switches or any other method?

Thanks.

sellcenterAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

David LeeCommented:
Hi, sellcenter.

It's possible with a bit of scripting.  Is that an option?
0
sellcenterAuthor Commented:
Yep, most definitely.  What did you have in mind?  Can you point me in the right direction?
0
David LeeCommented:
The script below will create and send a message.  You can incorporate the code into your script, if that's what you're using to monitor the folder and watch for the file, or call it from a batch file.
Dim olkApp, olkSes, olkMsg
Set olkApp = CreateObject("Outlook.Application")
Set olkSes = olkApp.GetNamespace("MAPI")
'Change the profile name on the next line'
olkSes.Logon "Outlook"
Set olkMsg = olkApp.CreateItem(0)
With olkMsg
    'Change the subject text on the next line'
    .Subject = "Your Subject Goes Here"
    'Change the body text on the next line'
    .Body = "Your message goes here"
    'Change the path and file name of the attachment on the next line'
    .Attachments.Add "Some file name and path foes here"
    'Change the address on the next line'
    .Recipients.Add "someone@company.com"
    .Recipients.ResolveAll
    .Send
End With
Set olkMsg = Nothing
olkSes.Logout
Set olkSes = Nothing
Set olkApp = Nothing

Open in new window

0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

sellcenterAuthor Commented:
Thanks.  I already have the code to send the email.

All I'm looking for now is a way for windows to run a batch file ( with command line arguments ) when a file is dropped into a directory.

Any ideas?
0
David LeeCommented:
Sorry, I guess I'm a little confused.  You asked, "Is this possible with any of Outlooks command line switches or any other method?"  I took that to mean that you already had a method of monitoring the folder and detecting when an item was added.  Outlook certainly can't monitor a file system folder for new files.  
0
mtucker25Commented:
This 3rd party software may work for you.  It watches a folder and then performs an action when it sees that a file has been added, updated, or deleted (you choose what to watch for).  Hope it helps.

http://www.sharewareconnection.com/file-and-folder-watcher.htm
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Alan HardistyCo-OwnerCommented:
This question has been classified as abandoned and is being closed as part of the Cleanup Program. See my comment at the end of the question for more details.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Outlook

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.