NateTut has asked for the wisdom of the Perl Monks concerning the following question:
use strict; use warnings; use Win32::OLE; use Win32; sub EMBED_ATTACHMENT {1454;} # from LotusScript # Open the email database in Lotus Notes my $notes = Win32::OLE->new('Notes.NotesSession') or die "Can't open Lotus Notes"; my $database = $notes->GetDatabase("",""); $database->OpenMail; opendir(DIR, "."); my @files = grep(/^\Q$ARGV[0].\E\d+$/,readdir(DIR)); closedir(DIR); foreach my $file (@files) { my $Document = $database->CreateDocument; $file =~ /\.(\d)+$/; my $FileNumber = $1; $Document->AppendItemValue ("Form", "Memo"); $Document->AppendItemValue ("SendTo", ['YourEMailHere@Domain.Com', +'YourEMailHere2@Domain.Com']); $Document->AppendItemValue ("Subject", "File:$ARGV[0] Part:$FileNum +ber"); my $Body = $Document->CreateRichtextItem('Body'); $Body->AppendText("File:$ARGV[0] Part:$FileNumber FileName:$file"); $Body->EmbedObject (EMBED_ATTACHMENT, '', qq/$file/); $Document->Send(0); }
|
|---|