Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Scripts that should use outlook.exe to send mails

by sagarkha (Acolyte)
on Oct 20, 2010 at 12:33 UTC ( #866304=perlquestion: print w/replies, xml ) Need Help??
sagarkha has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks, I want to write a script that should use outlook to send message. I google this and found there is command line option for outlook e.g
Outlook.exe /a C:\test.txt /c ipm.note /m test@yahoo.com,
but this opens a new window of outlook and you have to click on SEND button, but i want to send mails to multiple clients without pressing this button.

Replies are listed 'Best First'.
Re: Scripts that should use outlook.exe to send mails
by marto (Bishop) on Oct 20, 2010 at 12:46 UTC

    Are you sure you want to automate Outlook rather than send mail via a perl script using the same account/Exchange/mail server? See MIME::Lite.

Re: Scripts that should use outlook.exe to send mails
by sundialsvc4 (Abbot) on Oct 20, 2010 at 13:12 UTC

    ... And if you do want to use “outlook.exe” directly, I believe that you will find that Outlook has a well-featured OLE interface.   You should be able to refer to “the Outlook application,” “mailboxes,” “messages,” and pretty much every other “thing” that Outlook supports, through this mechanism.   And you should encounter no problems at all using this interface with Perl.

    “I normally don’t like to think well of Microsoft Corporation,” he grumbled.   “But this, even I must admit, is A Very Good Hack.™”

    Naturally, the first thing that you should do is to search http://search.cpan.org for the keyword, “Outlook.”   There we find, e.g. Mail::Outlook ...  

    Before setting forth to write anything new in Perl, always make it your business to research what might have already been done, especially in a case like this, where you know you are trodding a well-worn path.   Maybe what you find on CPAN will not be exactly what you’re looking for, but it will be close.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://866304]
Approved by marto
help
Chatterbox?
[ambrus]: Corion: I think I parsed a HTTP header from a string with LWP once. You can definitely use that to create a HTTP message too. The problme is
[ambrus]: that if you do that, you'd have to find where each HTTP response ends, which is nontrivial if you want persistent connections (essential for performance if you have small requests).
[Corion]: ambrus: Yes, ideally an API that I feed the incoming data piece by piece and that I can ask "is that response done" and "what should I do next" and "please construct the appropriate redirect for me"
[Corion]: ambrus: Yes, ideally the module would do all that nasty stuff for me and give me a way to ask it what the current situation is
[ambrus]: Corion: you could also consider using some wrapper over the multi interface of curl, I think Net::Curl might be a good one, since implementing enough of what it expects from the event loop might be easier than a full AnyEvent interface.
[ambrus]: Corion: you could also consider using IO::Async and its POE driver and some HTTP module for it, but I don't know if that would solve your problems with AnyEvent+POE
[ambrus]: Corion: wait, you didn't say POE. You said Prima, let me look up what that is.
[ambrus]: Corion: have you considered just writing an AnyEvent integration for that thing?
[ambrus]: Or perhaps pushing schmorp to write one?
[ambrus]: Also, searching for an existing one on CPAN obviously

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (11)
As of 2016-12-07 16:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (130 votes). Check out past polls.