reyjrar has asked for the wisdom of the Perl Monks concerning the following question:
$EMAILS is a comma delimited string of email addresses.. I've tried all sorts of combinations with \r and \n and can't seem to get it to work, the script acts as though its working, but it doesn't send me mail, the connections don't fail and no errors are thrown anywhere..if($EMAILS) { socket(MAIL,PF_INET,SOCK_STREAM,getprotobyname('tcp')) +; connect(MAIL,sockaddr_in(25,inet_aton($MAILHOST))) || +die "$!\n";; select MAIL; $|++; select STDOUT; print MAIL "HELO mydoamain.net\r\n"; print "Emailing users: "; for(split(/,/,$EMAILS)) { print "$_, "; print MAIL "MAIL FROM: $from\n"; print MAIL "RCPT TO: $_\n"; print MAIL "DATA\n"; print MAIL "Subject: $subject\n\n"; print MAIL "$data\n"; print MAIL ".\r\n"; } print "done. \n"; print MAIL "QUIT\r\n"; close MAIL; }
|
---|
Replies are listed 'Best First'. | |
---|---|
(Guildenstern) Re: baffled by the sendmail..
by Guildenstern (Deacon) on Nov 04, 2000 at 00:46 UTC | |
RE: baffled by the sendmail..
by Fastolfe (Vicar) on Nov 04, 2000 at 01:05 UTC | |
Re: baffled by the sendmail..
by reyjrar (Hermit) on Nov 04, 2000 at 02:01 UTC |