Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Trouble sending an email with Mailer module

Reply
Thread Tools

Trouble sending an email with Mailer module

 
 
laredotornado@zipmail.com
Guest
Posts: n/a
 
      01-31-2006
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

 
Reply With Quote
 
 
 
 
Ch Lamprecht
Guest
Posts: n/a
 
      01-31-2006
wrote:
> Hi,

use strict;
use warnings;

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


> my %headers = {From => "$p_sender",
> ^ To => "$p_recipient",
> ^ Subject => "$p_subject"
> ^ };

-------------^a hash --^ a hashref
> my $mailer = Mail::Mailer->new();
> $mailer->open(\%headers);
> print $mailer $body;
> $mailer->close;
>
> Any ideas? Thanks, - Dave
>


HTH Christoph
--

perl -e "print scalar reverse q//"
 
Reply With Quote
 
 
 
 
Gunnar Hjalmarsson
Guest
Posts: n/a
 
      01-31-2006
wrote:
> 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.

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: [sendmail,perl] How to catch a mailer error [perl script as sendmail.cf mailer] Andrzej Adam Filip Perl 0 03-31-2008 09:24 PM
problem sending mail: Sending the email to the following server failed Luke Java 2 03-15-2007 10:54 AM
Trouble w sending email =?Utf-8?B?S2VubmV0aCBQ?= ASP .Net 1 08-27-2005 12:10 PM
Robo -mailer. Sending me viruses. Alan Computer Support 1 07-11-2005 06:30 PM
Mailer-Daemon Email lee Computer Support 9 08-21-2003 08:18 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57