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

Re: How do I send E-mail via Microsoft exchange server from my Perl Program?

by Roger (Parson)
on Sep 26, 2003 at 07:01 UTC ( [id://294348]=note: print w/replies, xml ) Need Help??


in reply to How do I send E-mail via the Microsoft exchange server?

To send E-mail via the Microsoft exchange server, you need to use the MAPI interface. I have created an example below to send Email via exchange server:

use Win32::OLE; use strict; # Create a new MAPI session my $session = Win32::OLE->new("MAPI.Session") or die "Failed to create a new MAPI Session!"; # Logon to server my $res = $session->Logon("roger", "letmepass"); die "Could not log on to exchange server!" if ($res); # Create a new message my $msg = $session->Outbox->Messages->Add(); # Add the recipient and resolve the address my $recipient = $msg->Recipients->Add(); $recipient->{Name} = "someone@somewhere.com"; $recipient->Resolve(); # Add your text $msg->{Subject} = "Email Test"; $msg->{Text} = qq/ Email test .... will this work? Regards Roger /; # Send the email $msg->Update(); $msg->Send(0, 0, 0); # Log off $session->Logoff();
  • Comment on Re: How do I send E-mail via Microsoft exchange server from my Perl Program?
  • Download Code

Replies are listed 'Best First'.
Re: Answer: How do I send E-mail via Microsoft exchange server from my Perl Program?
by lnl (Pilgrim) on Apr 01, 2004 at 20:18 UTC

    OK... cool... then, how do you add an attachment? --lnl

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://294348]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2024-04-18 16:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found