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

OUTLOOK new mail with attachment

by harryC (Acolyte)
on Dec 11, 2012 at 09:29 UTC ( #1008250=perlquestion: print w/ replies, xml ) Need Help??
harryC has asked for the wisdom of the Perl Monks concerning the following question:

I only want to start outlook on de screen not in the background. Create a new mail and add a attachment.
So that the user can fill in the addresses,subject and the mail content and send the mail from the screen.
The same as in OpenOffice send document as attachment.
How do i do this ?
I looked around and always find code which sends mail in the background.
Thks for your help HarryC

my $Outlook = Win32::OLE->GetActiveObject ('Outlook.Application') || Win32::OLE->new('Outlook.Application'); $Outlook->{'Visible'} = 1;

does not work
Win32::OLE(0.1709) error 0x8002000e: "Ongeldig aantal parameters" in PROPERTYPUT "Visible" at D:\scripts\outlooktest.pl line 11


Thks for your help HarryC

Comment on OUTLOOK new mail with attachment
Download Code
Re: OUTLOOK new mail with attachment
by Anonymous Monk on Dec 11, 2012 at 09:38 UTC
Re: OUTLOOK new mail with attachment
by harryC (Acolyte) on Dec 11, 2012 at 11:41 UTC

    found is myself after hours op looking and is was so easy

    my $outlook = new Mail::Outlook(); # create a message for sending my $message = $outlook->create(); $message->To(' '); $message->Cc(' '); $message->Bcc(' '); $message->Subject(' '); $message->Body(' '); # attachments are appended $message->Attach("$home_dir\\test.pdf"); # so multiple calls ar +e allowed $message->display;

    you must have ' ' otherwise it does not work rgds HarryC

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1008250]
Approved by Athanasius
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (7)
As of 2014-12-29 13:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (188 votes), past polls