Maybe there is a perl solution to this problem.....maybe not.  I
have a distribution list with several hundred names in it (now these names
are in the format "Perl Beginners" not "[EMAIL PROTECTED]" and I cannot
figure out how to tell Outlook to give me the fully qualified adresses -
That alone would solve this problem), and we want to add this to a automatic
process.  

        Previously we used the code snippet below, but Outlook 2000 will not
allow it (it prompts the 'user' with a "ARE YOU SURE YOU WANT TO LET ANOTHER
PROCESS SEND MAIL THROUGH YOUR OUTLOOK ACCOUNT", Bill Gates is an idiot, I
know).  We moved onto a program called postie.exe, but it obviously will not
recogonize the 'short names' from Outlook.  Any thoughts on this?


#Using OLE object
sub mail {
    @files = @_;
     if ( @mailRecipients ) {
        use Win32::OLE;
        eval {$outlook =
Win32::OLE->GetActiveObject('Outlook.Application')};
        unless (defined $outlook) {
            $outlook = Win32::OLE->new('Outlook.Application', sub
{$_[0]->Quit;})
         }
    }
     if (defined $outlook) {
        $message = $outlook->CreateItem(0);
        $message->{BCC} = join(";", @mailRecipients);
        $attachments = $message->{Attachments};
                        foreach $att (@files) {
                                $attachments->Add($att);
            }
                if (! $subjects ) {
                  $message->{Subject}= join(";", @files);
                } else {
                  $message->{Subject}= $subjects;
                }
        $message->Send;
        
        undef $message;
        undef $att;
        @files = ();
      }
}


#Current version using postie.exe ....not very perlish anymore
@mailRecipients = ("Frank McCollum");
$sendmail = &mail;
sub newmail {
        @files = @_;
    $mailToolPath =
"R:/usr/rer/prod/current/Frameworks/NBFoundation.framework/Resources/postie.
exe";
    $mailServer = "maracas.ncmi.com";
    $mailRecipientsStr = join(",", @mailRecipients);
    $mailSubject = "\"" .$subjects;
    $mailSender = "frank.mccollum\@bankofamerica.com";
    $mailStr = "${mailToolPath} -nomsg -host:\"${mailServer}\"
-to:\"${mailRecipientsStr}\" -from:\"${mailSender}\" -s:\"${mailSubject}\"";
            foreach ( @files ) {
                        $mailStr = $mailStr . " -a:\"$_\" ";
                }
 
    system($mailStr);
    print "\n$mailStr\n";
}


Thanks,
Frank McCollum
Bank Of America Securities, LLC
[EMAIL PROTECTED]
(704) 388-8894



_____________________________________________________________________ 
IMPORTANT NOTICES: 
          This message is intended only for the addressee. Please notify the
sender by e-mail if you are not the intended recipient. If you are not the
intended recipient, you may not copy, disclose, or distribute this message
or its contents to any other person and any such actions may be unlawful.

         Banc of America Securities LLC("BAS") does not accept time
sensitive, action-oriented messages or transaction orders, including orders
to purchase or sell securities, via e-mail.

         BAS reserves the right to monitor and review the content of all
messages sent to or from this e-mail address. Messages sent to or from this
e-mail address may be stored on the BAS e-mail system.
                                                                                
____________________________________________________________________

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to