in reply to Re: Re: Mail::Sender returns malformed address
in thread Mail::Sender returns malformed address

The address is in the form:

myname@somewhere.com.

Are you sure?

I'd be interested in seeing the STDERR of this (run as a cron)...

use Data::Dumper; $sender->MailFile( {to => $addr, subject => 'HP Notify Attachment', msg => "The attachment sent courtesy of $sname.", file => $fname }); warn "Unexpected addr: '$addr'" unless ($addr eq 'myname@somewhere.com'); warn Dump($sender);

As I recall, the only thing Mail::Sender ever does to a 'to' addr, is replace sequences of whitespaces with a single ", " -- so I would guess either you aren't including myname in your $addr properly, or you have some whitespace seperating if from @somewhere so your SMTP server winds up seeing:

To: myname, @somewhere.com

Replies are listed 'Best First'.
Re: Re: Re: Re: Mail::Sender returns malformed address
by killraven (Novice) on Mar 26, 2002 at 16:22 UTC
    Using the following code:
    $sender->MailFile( {to => $addr, subject => 'HP Notify Attachment', msg => "The attachment sent courtesy of $sname.", file => $fname }); warn "Unexpected addr: '$addr'" unless ($addr eq 'tompkic1@universalleaf.com'); print "Addr is $addr\n"; warn Dumper($sender); exit;
    I got the following output:
    Addr is tompkic1@universalleaf.com $VAR1 = bless( { 'sin' => 'ĒV', 'client' => 'localhost', 'from' => '@universalleaf.com', 'replyaddr' => undef, 'boundary' => 'Message-Boundary-19990614', 'fromaddr' => '@universalleaf.com', 'proto' => 6, 'debug' => 0, 'multipart' => 'Mixed', 'port' => 25, 'subject' => 'HP Notify Attachment', 'replyto' => '@universalleaf.com', 'idcounter' => 0, 'error' => -5, 'smtp' => '150.150.199.86', 'socket' => bless( \*Symbol::GEN0, 'FileHandle' ), 'to' => 'tompkic1@universalleaf.com', 'smtpaddr' => 'ĒV' }, 'Mail::Sender' );
    Thanks, killraven
Re: Re: Re: Re: Mail::Sender returns malformed address
by killraven (Novice) on Mar 26, 2002 at 18:13 UTC
    Blind I am. It was the from address that was messing up. The Dumper trick opened by eyes. Thanks hossman. Thanks you all for your help. killraven