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

The address is in the form:
myname@somewhere.com.

Replies are listed 'Best First'.
Re: Re: Re: Mail::Sender returns malformed address
by hossman (Prior) on Mar 25, 2002 at 22:24 UTC
    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
Re: Re: Re: Mail::Sender returns malformed address
by zentara (Cardinal) on Mar 25, 2002 at 21:38 UTC
    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.