I am new to perl so excuse my ignorance, I have a csv file with char fields and am using DBI to access fields, one of these has a email address in, I have assigned the resulting email field to $email and can print it out to screen. When I try to use sendmail in the send_mail sub routine it does not work, hope you can help.
sub send_email {
$mailprog = '/usr/sbin/sendmail';
open(MAIL,"|$mailprog -t"
print MAIL "To: $email\n";
print MAIL "From: Billy the fish\n";
print MAIL "Subject: Testing the sendmail\n\n";
close (MAIL);
}
sub send_email {
$mailprog = '/usr/sbin/sendmail';
open(MAIL,"|$mailprog -t"
print MAIL "To: $email\n";
print MAIL "From: Billy the fish\n";
print MAIL "Subject: Testing the sendmail\n\n";
close (MAIL);
}