Subject: | MailMsg destroys the passed-in argument hash |
A construct like the following fails for all but the first recipient
because the message body is destroyed by the first send:
my $message_params = {
from => $from,
subject => $form->{name} || $form->{title},
msg => $message,
};
foreach my $recipient( @recipients ) {
$message_params->{to} = $recipient;
$sender->MailMsg( $message_params ) or die "$recipient:
".$Mail::Sender::Error;
}
It is not clear to me whether other fields are likewise affected, but
this seems to be unreasonable behavior as there is nothing I found in
the documentation of MailMsg that suggested that the hashref I pass to
the function would be altered.
This was discovered under Perl 5.8.5 on Linux 2.6.9-22