T
Two Heads
Hi,
I apologise if this is not strictly a Perl question but I am not sure
where else to post this.
One of my scripts sends an automated email to the customer. However if
the email address is no longer valid the server(?) seems to return a
message to the script informing it that the mail attempt failed and a
copy of the mail is held in a certain folder.
However the script is not expecting this message and the message seems
to want to print itself to the screen causing the script to fail. The
code for the mail routine is as follows;
open(MAIL, "|$sendmailLoc $tenantMail")|| die "Cant send mail!\n";
print MAIL "Subject: Rent Account Arrears Warning\n";
print MAIL "From: $clientTitle\n";
print MAIL "Message from $clientTitle\n
For the attention of: $tenant\n\n";
print MAIL "$arrsMessage\n\n";
print MAIL "Account balance $curr_bal\n";
close (MAIL);
Is there a way I can catch the error message so that I can forward it
elsewhere?
Thanks for your interest,
Mark
I apologise if this is not strictly a Perl question but I am not sure
where else to post this.
One of my scripts sends an automated email to the customer. However if
the email address is no longer valid the server(?) seems to return a
message to the script informing it that the mail attempt failed and a
copy of the mail is held in a certain folder.
However the script is not expecting this message and the message seems
to want to print itself to the screen causing the script to fail. The
code for the mail routine is as follows;
open(MAIL, "|$sendmailLoc $tenantMail")|| die "Cant send mail!\n";
print MAIL "Subject: Rent Account Arrears Warning\n";
print MAIL "From: $clientTitle\n";
print MAIL "Message from $clientTitle\n
For the attention of: $tenant\n\n";
print MAIL "$arrsMessage\n\n";
print MAIL "Account balance $curr_bal\n";
close (MAIL);
Is there a way I can catch the error message so that I can forward it
elsewhere?
Thanks for your interest,
Mark