vit has asked for the wisdom of the Perl Monks concerning the following question:
sub EmailBySendmail { my $to_ptr = shift; my $from = shift; my $subject = shift; my $message = shift; foreach my $to_ad (@$to_ptr) { unless(open (MAIL, "|/usr/sbin/sendmail -t")) { print "error.\n"; warn "Error starting sendmail: $!"; } else { print MAIL "From: $from\n"; print MAIL "To: $to_ad\n"; print MAIL "Subject: $subject\n\n"; print MAIL "$message"; close(MAIL) || warn "Error closing mail: $!"; print "Mail sent.\n"; } } return; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: sendmail close error
by mr_mischief (Monsignor) on Jul 20, 2011 at 21:50 UTC | |
|
Re: sendmail close error
by onelesd (Pilgrim) on Jul 20, 2011 at 18:28 UTC | |
|
Re: sendmail close error
by Marshall (Canon) on Jul 20, 2011 at 18:30 UTC | |
by vit (Friar) on Jul 20, 2011 at 19:53 UTC | |
by Marshall (Canon) on Jul 20, 2011 at 21:56 UTC | |
by vit (Friar) on Jul 21, 2011 at 18:46 UTC | |
by Marshall (Canon) on Jul 21, 2011 at 21:35 UTC | |
|
Re: sendmail close error
by stonecolddevin (Parson) on Jul 21, 2011 at 19:48 UTC |