I've been reading through the documentation, but I can't find the
answer. Can someone tell me how to generate a blank envelope-sender in
an outgoing message. I want to generate a message that won't bounce if
it is not deliverable.
The following program generates the following error:
Can't call method "isa" on an undefined value at
/usr/lib/perl5/site_perl/5.8.1/Mail/Transport/SMTP.pm line 48.
#!/usr/bin/perl -w
use Mail::Message;
use Mail::Transport::SMTP;
use Mail::Message::Field;
use Mail::Address;
use strict;
my $message = Mail::Message->build (
From => Mail::Address->new('MD',
'matthew@xxxxxxxxxxxxxxxxxx'),
Sender => '<>',
To => 'matthew@xxxxxxxxxxxxxxxxxx',
Subject => 'test',
data => 'foo'
);
my $mailer = Mail::Transport::SMTP->new('hostname' => 'ottonexc1');
if ($mailer->send($message)) {
print "ok\n";
} else {
print "oops\n";
}
|