Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Trouble using Mail::Outlook

by PerlRocks6345 (Novice)
on Dec 04, 2012 at 06:44 UTC ( #1007015=perlquestion: print w/replies, xml ) Need Help??
PerlRocks6345 has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks,I am at a situation to use Mail::Outlook only to send mail.When i send a mail it gets saved in my outbox and the following message gets displayed

OLE exception from "Microsoft Outlook": The item has been moved or deleted. Win32::OLE(0.1709) error 0x80020009: "Exception occurred" in PROPERTYPUT "To" at C:/Perl/site/lib/Mail/Outlook/ line 380

This is my code..Any suggession will be usefull.Thank you Monks!!!

use strict; use warnings; use Data::Dump; use Mail::Outlook; use Win32::OLE::Const 'Microsoft Outlook'; Win32::OLE->Option(Warn => 3); my $outlook = new Mail::Outlook('Inbox'); my $file = "D:/TEMP2/Text1.txt"; my $message = $outlook->create(); $message->To(''); $message->Subject('Test'); $message->Body('Test Message'); $message->Attach($file); $message->send; dd [ $message->display ];

Replies are listed 'Best First'.
Re: Trouble using Mail::Outlook
by ColonelPanic (Friar) on Dec 04, 2012 at 09:57 UTC

    My first thought is: what are you trying to do, and can you do it without calling Outlook?

    Outlook varies greatly between versions. Some versions are very buggy, as I have learned by painful experience (I tried to automate some Outlook functions through VB, only to encounter showstopper bugs in Outlook that killed the entire project). In addition, the Mail::Outlook module has not been updated in several years. That is bound to be problematic as new versions of Outlook come along.

    Here are some other options for sending email:

    This discussion of sending email from Windows, though old, might still be useful.

    In my opinion, unless your task specifically requires Outlook, you will probably do better with a non-Outlook solution.

    Addendum: I did try to install Mail::Outlook and test your code, but the module installation failed. Does this prove my point or only my own laziness? You decide.

    When's the last time you used duct tape on a duct? --Larry Wall

      Hey thanks a lot for your suggestions..My project requires outlook to be integrated to sent mail.My code worked I had to enable "send and receive all folders" in my outlook. It installed pretty well my me, try installing using

       cpan install Mail::Outlook


      cpan i Mail::Outlook

      from your command line.Thanks a lot for your suggestions

        Outlook is an email client, why not send emails directly to the target mail server from your script using something like MIME::Lite? As has been explained to you, the Outlook application is not necessary to send emails. Nobody suggested that Mail::Outlook would not install, rather that it hasn't been updated for years, has known bugs and may not work as expected with the version of Outlook you are running.

        I'm glad to hear that you got it working. I did use CPAN to install--not sure why it failed, but I didn't spend too much time looking into it.

        When's the last time you used duct tape on a duct? --Larry Wall

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1007015]
Approved by kcott
[Your Mother]: Yep, LanX, here is the reverse operation: perl -CSD -MEncode -MMIME::Base64 -E 'say decode_utf8( decode_base64(" 4oGZ"))'
[LanX]: Thanks Many thanks YM... it was already supposed to be encoded, I'll see tomorrow
[Your Mother]: I am entirely skeptical the wall will happen… but this country does love its boongdoggles now and then. :P
[Your Mother]: Did I tell or show you? There is a leucistic Turkey Vulture around here all the time. I have a couple decent pictures.
[Your Mother]: Pure white (well, dirty white :P)
[erix]: as a kid I had a painted bunting -- beautiful
[Your Mother]: I would love to see one. It would be a lifer.
[Your Mother]: Wait… maybe I did see one last year…
[Your Mother]: I saw what I thought was a Cuban trogon but they are too impossibly rare / never seen in the US. That guy might have been what I actually saw.
[LanX]: Good Night guys!

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2017-01-20 01:34 GMT
Find Nodes?
    Voting Booth?
    Do you watch meteor showers?

    Results (173 votes). Check out past polls.