cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with sendmail

wagsite
Newbie
Posts: 9
Registered: 28-09-2007

Problem with sendmail

I have a lot of Perl code that uses sendmail to send emails notifying me and others of user requests. This all worked fine for at least two years. When the Crofters change happened a couple of months ago, it stopped working. The code I am using is shown below. $mailprog is "/usr/sbin/sendmail". Does anyone have any ideas why it is no longer working?

sub send_mail {
my ($to, $from, $cc, $subject, @message) = @_;
my ($line);
open (MAIL, "|$mailprog -t") || print "Can't start mail program";
print MAIL "To: $to\n";
print MAIL "From: $from\n";
print MAIL "Cc: $cc\n";
print MAIL "Subject: $subject\n";
print MAIL "-" x 75 . "\n\n";
foreach $line(@message) {
print MAIL "$line\n";
}
print MAIL"\n\n";
close (MAIL);
}
1 REPLY
wagsite
Newbie
Posts: 9
Registered: 28-09-2007

Problem with sendmail

have looked into this further and discovered that the problem is with multiple addresses and using "cc". Have posted a new topic so ignore this one.