in reply to Sendmail to non-working email address
Wrap your sendmail portions in an eval block:
eval { open (SENDMAIL, '|/usr/sbin/sendmail -oi -t'); print SENDMAIL <<"EOF"; From:<$MAIL{'FROM'}> To:<$MAIL{'TO'}> Subject: $MAIL{'SUBJECT'} $MAIL{'BODY'} EOF close (SENDMAIL); }; if($@) { print "Something went wrong!\n"; }
----
I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
-- Schemer
Note: All code is untested, unless otherwise stated
|
|---|