* Vic Norton (vic@xxxxxxxxxxx) [050207 21:10]:
I copied your suggestion directly into the script I presented,
Gilles. I get exactly the same error message.
> /Library/Perl/5.8.1/Mail/Message/Head/Complete.pm: Line 172:
Can't call method "clone" without a package or object reference
What version of MailBox are you running? In my version, the clone is
on line 198...
The problem came up when I was tried to create a plain text mail
message and then, in a loop, change the to-field and body before
sending it out. So far I've been totally unsuccessful in doing this.
Perhaps the way I had been doing it before was better anyway. Then I
would just create a new head, new body, and new message on each
iteration of the loop.
>$msg->head->reset( 'To', Mail::Message::Field->new( 'To', "\"Vic\"
><norton\@dacor.net>") ) ;
This certainly should work. I have tried it out.
Simpler is
$msg->head->set(To => '"Vic" <norton@xxxxxxxxx>' ) ;
An other way to get your task to work is:
my $msg = Mail::Message->build(....);
$msg->send(to => '"Vic" <norton@xxxxxxxxx>' );
The destination will not be visible in the sent headers, but plays its
role in the SMTP protocol.
--
MarkOv
------------------------------------------------------------------------
drs Mark A.C.J. Overmeer MARKOV Solutions
Mark@xxxxxxxxxxxx solutions@xxxxxxxxxxxx
http://Mark.Overmeer.net http://solutions.overmeer.net