Pugdog (or anyone else),
When I add the Bcc tag to Mailer.pm as follows:
my $s = &FileHandle::new('FileHandle');
open ($s, "|$self->{'sendmail'}");
print $s "To: ", $self->{'to'}, "\n";
print $s "From: ", $self->{'from'}, "\n";
print $s "Reply-to: ", $self->{'reply'}, "\n" if $self->{'reply'};
if ($self->{'subject'} eq 'hotHOCKEY Links: Site Referral') {
print $s "Bcc: ", $LINKS{db_admin_email}, "\n";
}
print $s $self->{'headers'}, "\n" if $self->{'headers'};
print $s "X-Mailer: gossamer-threads.com\n";
print $s "Subject: ", $self->{'subject'}, "\n\n";
print $s $self->{'msg'};
close $s;
$self->log_msg() or return undef;
return 1;
}Everything seems to work fine with recommend_it.cgi. However, when I try to use add.cgi, I get a software error saying that the there was a problem accessing the mailer. Where the error occurs is at:
require Links::Mailer;
$mailer = new Links::Mailer ( {
smtp => $LINKS{db_smtp_server},
sendmail => $LINKS{db_mail_path},
from => $from,
subject => $subject,
to => $to,
msg => $msg
} ) or die $Links::Mailer::error;
$mailer->send or die $Links::Mailer::error;Any idea what is wrong?
When I add the Bcc tag to Mailer.pm as follows:
Code:
# Get a filehandle, and open pipe to sendmail. my $s = &FileHandle::new('FileHandle');
open ($s, "|$self->{'sendmail'}");
print $s "To: ", $self->{'to'}, "\n";
print $s "From: ", $self->{'from'}, "\n";
print $s "Reply-to: ", $self->{'reply'}, "\n" if $self->{'reply'};
if ($self->{'subject'} eq 'hotHOCKEY Links: Site Referral') {
print $s "Bcc: ", $LINKS{db_admin_email}, "\n";
}
print $s $self->{'headers'}, "\n" if $self->{'headers'};
print $s "X-Mailer: gossamer-threads.com\n";
print $s "Subject: ", $self->{'subject'}, "\n\n";
print $s $self->{'msg'};
close $s;
$self->log_msg() or return undef;
return 1;
}
Code:
# Then mail it away! require Links::Mailer;
$mailer = new Links::Mailer ( {
smtp => $LINKS{db_smtp_server},
sendmail => $LINKS{db_mail_path},
from => $from,
subject => $subject,
to => $to,
msg => $msg
} ) or die $Links::Mailer::error;
$mailer->send or die $Links::Mailer::error;