On 10/31/05, Matthew Sacks <[EMAIL PROTECTED]> wrote:
> Trying to use Mail::Mailer, in the sample code below.
>
> i) if I put -T on the first line invoking Perl, I get
> an error like "too late for -T option"
> ?????
>
> ii) The program runs but the mail never arrives. The
> eval block checks always succeed.  Where is the mail
> going?
>
> -matthew sacks
>
>
>
> #!/usr/bin/perl
>
> use warnings;
> use strict;
>
> use Mail::Mailer qw(sendmail);
>
> my $mailer = new Mail::Mailer ('sendmail');
>
> my %headers = (To => '[EMAIL PROTECTED]',
>                From => '[EMAIL PROTECTED]',
>                Subject => 'mail test');
> eval {
> $mailer->open(\%headers);
> };
> if ($@) {
>    print "the open failed: [EMAIL PROTECTED]";
> }
> eval {
> print $mailer "This is the third test message.";
> };
> if ($@) {
>    print "the print failed: [EMAIL PROTECTED]";
> }
>
> $mailer->close;
>
>

You aren't testing the important part, whether it sends. Try

    $mailer->close or die "sending failed: $!";

See if that doesn't turn up somethnig useful.

Other places to look: can you send mail from the command line as this
user via mailx? is the sendmail binary in the path when this script is
running? Do you have any other issues with the sendmail installation
on this machine? is your local sendmail installation setup to allow
you to send mail as someone else, or could you be running into some
rewrite issues trying to send a message as [EMAIL PROTECTED] Is
the message turning up in the spool? What do the sendmail logs say?

There are a lot of places for this to go wrong, and we need a little
more information.

-- jay
--------------------------------------------------
This email and attachment(s): [  ] blogable; [ x ] ask first; [  ]
private and confidential

daggerquill [at] gmail [dot] com
http://www.tuaw.com  http://www.dpguru.com  http://www.engatiki.org

values of β will give rise to dom!

Reply via email to