Using the following program, I managed to send a message with an attachment to 
multiple recipients using option 2, but not with options 1 and 3:

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
use Mail::Sender;
$address1   = '[EMAIL PROTECTED]';
$address2   = '[EMAIL PROTECTED]';

#$recipients = [$address1, $address2];        # 1. not OK
#$recipients = $address1 . ',' . $address2;    # 2.  OK
push @recipients, $address1, $address2;     # 3. not OK

$sender     = 'tchau\@w3.bchydro.bc.ca';
$server     = 'w3';
$attachment = '\temp\normal.txt';

$sender = new Mail::Sender {smtp => $server, from => $sender} or die "$! connect 
error";
#$sender->MailFile({to => $recipients,        # Used with options 1 and 2
$sender->MailFile({to => \@recipients,      # Used with option 3
  subject => 'Here is the file',
  msg => "I'm sending you the file that you wanted. (2 recipients)",
  file => $attachment}) or die "$! send error";
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

I got the following message:

No such file or directory send error at test3.pl line 13


Strangely enough, I was able to send multiple files using all three variations (list 
separated by commas, reference to an anonymous array or reference to an array).

Can anyone tell me what the problem is?  Thanks.

Reply via email to