I've been using the following code for years. Suddenly it stopped working. Here is a sendmail test I'm running on the host account:
#!/usr/bin/perl -w BEGIN { open (STDERR, ">error.txt") || die("Sorry - cannot open error.txt"); } use CGI qw(:cgi-lib); use CGI::Carp qw(fatalsToBrowser); use strict; my($email_body, $sender, $mail_program, $email_to, $email_subject); $email_body="Surely CPC is not alone as a victim of this relatively ne +w behavior. \n"; $email_to='arthurdoyle1@aol.com'; $sender='cpc@meshingwithgears.us'; $mail_program = "/usr/lib/sendmail -f$sender -t"; open(MAIL,"|$mail_program") || die("Sorry - Cannot open mail program. +Please contact our website via E-mail or try again later."); print MAIL "Reply-to: $sender\n"; print MAIL "To: $email_to\n"; print MAIL "From: $sender\n"; print MAIL "Subject: $email_subject\n"; print MAIL "Content-type: text/plain\n\n"; print MAIL "$email_body"; close (MAIL); print "</BODY></HTML>";; exit;
Error.txt file returns this line:
Mon Jan 30 14:37:09 2017 esender.cgi: Can't exec "/usr/lib/sendmail": No such file or directory at esender.cgi line 24.
Isn't sendmail part of the original PERL installation?
Trying for two weeks to resolve this with Host Support and so far, getting nowhere.
In reply to PERL Sendmail Problem by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |