Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Mail::Sendmail Cannot Send out email

by Gary Yang (Acolyte)
on May 02, 2012 at 19:52 UTC ( #968523=perlquestion: print w/ replies, xml ) Need Help??
Gary Yang has asked for the wisdom of the Perl Monks concerning the following question:

Hi,
I got the errors when I tried to send out email.

CPT TO: error (553 sorry, that domain isn't in my list of allowed rcpthosts (#5.7.1))

Below is the code. Please help.

#!/opt/ActivePerl-5.14/bin/perl -w use Mail::Sendmail qw(sendmail %mailcfg); my (%mail, $MailTo, $subject, $message, $from); $mailcfg{smtp} = [qw(mail.mycompany.com)]; $mailcfg{port} = 25; # default $MailTo = 'someone1@yahoo.com'; $from = 'someone2@yahoo.com'; $subject = "Test"; $message = "Message Test"; %mail = ( To => $MailTo, From => $from, Subject => $subject, Message = +> $message); sendmail(%mail);

Comment on Mail::Sendmail Cannot Send out email
Download Code
Re: Mail::Sendmail Cannot Send out email
by stevieb (Hermit) on May 02, 2012 at 20:08 UTC

    This is a QMail server error. The server is informing you that a) the email address is not local and b) it won't relay it for you. You'll have to contact the server administrator and talk to them about what you're trying to do.

Re: Mail::Sendmail Cannot Send out email
by trwww (Priest) on May 03, 2012 at 04:34 UTC

    To extend on stevieb's reply, you probably need to provide credentials (perhaps a username and password) in order to relay from this server. Mail::Sendmail doesn't support this. So if this is indeed the part you're missing, you'll have to pick another email module or write your own that does support SMTP authorization.

      ... or install a local mail server (e.g. postfix), configure that correctly, and tell Mail::Sendmail to use localhost.

      perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'
Re: Mail::Sendmail Cannot Send out email
by mendeepak (Beadle) on May 04, 2012 at 06:40 UTC

    Hi This error message indicates that the remote server has rejected your message due to your host not being on a list of servers able to send the destination server mail. This error can also indicate that your e-mail address or server is listed on a DNS blacklist. You will need to contact the remote server administrator for assistance with this issue. This error has nothing to do with module, it is a problem with the remote host

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://968523]
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2014-09-19 23:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (151 votes), past polls