#!/usr/bin/perl
use Data::Dumper;
use Mail::Box::Manager;
my $manager = Mail::Box::Manager->new;
$ENV{MAIL}='/home/eml/aaab';
$mailboxname=$ENV{MAIL};
my $mgr = Mail::Box::Manager->new;
my $folder = $mgr->open ( folder => $mailboxname , extract => 'LAZY' , access => 'rw' , save_on_exit => 0);
$ar=$folder->message(2);
my $subject = $ar->subject;
print Dumper($subject)."\n";
-----------------------------------------------------------
另外个实例
my $msg = Mail::Message->new(head => $head);
$msg->body($body);
#print Dumper($msg)."\n";
ok(defined $msg);
#
# Create a simple forward
#
my $forward = $msg->forward
( strip_signature => undef
, prelude => undef
, postlude => undef
, quote => undef
, To => 'dest@example.com (New someone)'
);
use Email::Sender::Transport::Maildir;
my $maildir='/home/eml/aaab';
my $sender = Email::Sender::Transport::Maildir->new({ dir => $maildir,});
my $result = $sender->send(
$forward,
{
to => [ 'rjbs@example.com' ],
from => 'rjbs@example.biz',
}, );
ok(defined $forward, 'created simple forward');
isa_ok($forward, 'Mail::Message');
my @f = $forward->body->string;
阅读(626) | 评论(0) | 转发(0) |