#!perl -w use strict; use Win32::OLE; my $servername = 'NOTES1/CORPSERVER'; #your server name here # my $db_path = 'mail\ltcrepor.nsf'; #your mail database here # my $pw = 'LTCREPORTS'; #your password here my $db_path = 'mail\dbase.nsf'; #your mail database here my $pw = 'password'; #your password here my $Notes = Win32::OLE->new('Lotus.NotesSession') or die "Can't get NotesSession object.\n"; $Notes->Initialize($pw); my ($Version) = ($Notes->{NotesVersion} =~ /\s*(.*\S)\s*$/); my $User = $Notes->{UserName}; my $Platform = $Notes->{Platform}; my $Database = $Notes->GetDatabase($servername,$db_path) or die "Cannot access database"; my $Document = $Database->CreateDocument; $Document->AppendItemValue ("Form", "Memo"); # ***MULTIPLE RECIPIENTS SHOULD BE AN ARRAY OF STRING ELEMENTS*** my @recipients = ('cat@hat.com', 'rush@gasbag.org'); print @recipients; $Document->AppendItemValue ("SendTo", @recipients); $Document->AppendItemValue ("Subject", "Lotus Notes email from Perl script"); my $Filename = "C:\\OLEnotes.txt"; my $Body = $Document->CreateRichtextItem('Body'); $Body->AppendText(<<"EOT"); This here is the body text of the email. Kind regards, Mary EOT $Body->EmbedObject (1454, "", $Filename, "Attachment"); $Document->Send(0);