Directly changing To & From field in the header
"Zaphod" <[email protected]> Sat, 5 Feb 2005 19:25:04 -0800
| Newsgroups | gmane.comp.lang.perl.modules.mail-box |
|---|---|
| Message-ID | <007501c50bfb$74130eb0$ddf07c44@mainrkclov3cts> |
Hello all.
I am rather new to MailBox (3 Days actually) so please bear with me, my question my be quite simplistic since I am almost equally new to OOP.
I would like to be able to simply change the To & From lines in the header and send the message.
Here is what I am trying to do, it does not work it pops an error(see below)
use Mail::Box::Manager 2.00;
my $InBoxName='/home/foobar/mail/foobar/inbox';
my $Manager = Mail::Box::Manager->new;
my $Folder = $Manager->open($InBoxName,extract=>'LAZY', access=>'rw');
die "Cannot open $InBoxName: $!\n" unless defined $Folder;
my $Counter=0;
foreach $Message ($Folder->messages){
if($Counter==0){$Counter++;next;}
$Message->reset('To','[email protected]');
$Message->reset('From','[email protected]');
$Message->send
}
throws the following error message;
Method reset() is not defined for a Mail::Box::Mbox::Message.
Mail::Reporter::AUTOLOAD('Mail::Box::Mbox::...','From','vailmail@truckloa...') called at /usr/lib/perl5/site_perl/5.8.3/Mail/Message/Construct.pm line 61
Mail::Message::AUTOLOAD('Mail::Box::Mbox::...','From','vailmail@truckloa...') called at test2.cgi line 24
Am I way offbase or is there something simple I am missing in my OOP/MailBox naïveté.