Trouble sending an email with Mailer module

L

laredotornado

Hi,

I'm having some trouble getting the Mailer module to work. I keep
getting this error

No recipient addresses found in header

although in my code, below, I include a "To" clause. But clearly I'm
doing something wrong ...

my $body = "Blah blah blah:\n\n";

my %headers = {From => "$p_sender",
To => "$p_recipient",
Subject => "$p_subject"
};
my $mailer = Mail::Mailer->new();
$mailer->open(\%headers);
print $mailer $body;
$mailer->close;

Any ideas? Thanks, - Dave
 
G

Gunnar Hjalmarsson

I'm having some trouble getting the Mailer module to work. I keep
getting this error

No recipient addresses found in header

although in my code, below, I include a "To" clause. But clearly I'm
doing something wrong ...

Indeed you are; you ask for help here before asking Perl to help you by
using warnings.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,282
Latest member
RoseannaBa

Latest Threads

Top