This worked for me:





$ActiveSession = CreateObject OLE "MAPI.session" || 
        die "CreateObject: $!";
$LogonName = "Microsoft Outlook";
die "Logon: $!" if $ActiveSession->Logon($LogonName, 
        $LogonPasswd); # Logon returns 0 on success
$Message->Logoff();

sub send_email {
        $Message = $ActiveSession->Outbox->Messages->Add();
        $Recipient = $Message->Recipients->Add();
        $Recipient->{Name} = $_[0];
        $Recipient->{Type} = 1; # ugly constant, means this is a To address
        $Recipient->Resolve();
        $Message->{Subject} = "test message - please ignore";
        $Message->{text} = "$name has been successfully FTPed to xxxxxxx";
        $Message->Update();
        $Message->Send(1, 0, 0);
}
                Ed Ewen
                (404) 575-3531
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> 


        -----Original Message-----
        From:   [EMAIL PROTECTED]
[SMTP:[EMAIL PROTECTED]]
        Sent:   Thursday, May 04, 2000 3:16 PM
        To:     Perl-Win32-Users Mailing List
        Subject:        simple email question




        I'm using NT 4 and I simply want to send myself an email in my perl
script
              if something doesn't happen.  What is the simplest way to do
this?



        Thanks!



        Chuck



        ---
        You are currently subscribed to perl-win32-users as:
[EMAIL PROTECTED]
        To unsubscribe, forward this message to
                 [EMAIL PROTECTED]
        For non-automated Mailing List support, send email to  
                 [EMAIL PROTECTED]

---
You are currently subscribed to perl-win32-users as: [archive@jab.org]
To unsubscribe, forward this message to
         [EMAIL PROTECTED]
For non-automated Mailing List support, send email to  
         [EMAIL PROTECTED]

Reply via email to