NateTut has asked for the wisdom of the Perl Monks concerning the following question:

I need some help with the script below. I need to send some files from Lotus Notes. It is working fine (it sends e-mails) except that it doesn't send the attachment. I've searched PM and the web and as far as I can tell what I have should work, but it doesn't. Am I missing something obvious?

Update: I discovered the problem. It needed the full path on the file name.

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); }