in reply to Mail::Sender returns malformed address

what is the address? if it is "@somewhere.com" (as reported in the error message,) it's not valid. check your data.

~Particle ;Þ

  • Comment on Re: Mail::Sender returns malformed address

Replies are listed 'Best First'.
Re: Re: Mail::Sender returns malformed address
by killraven (Novice) on Mar 25, 2002 at 18:47 UTC
    The address is in the form:
    myname@somewhere.com.
      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
        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
        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
      Have you tried to escape the @ ? Like: myname\@somewhere.com I've noticed alot of scripts require the escaping if the address is in double quotes. It's worth a try.