Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

OUTLOOK new mail with attachment

by harryC (Sexton)
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\ line 11

Thks for your help HarryC

Replies are listed 'Best First'.
Re: OUTLOOK new mail with attachment
by harryC (Sexton) 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

Re: OUTLOOK new mail with attachment
by Anonymous Monk on Dec 11, 2012 at 09:38 UTC

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1008250]
Approved by Athanasius
[nettop]: need to hire a PERL programmer
[shmem]: conditions?
[shmem]: tell them

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (7)
As of 2018-04-20 17:20 GMT
Find Nodes?
    Voting Booth?