N
Nex_s
Hi All,
I'm doing my best to get through this one. I want to error check on
each part of the FTP process. If it fails I want to call an e-mail
sub. Unfortunately the FTP process prints an error and as such my
script fails. For some reason I also can't pass the appropriate error
message to the e-mail sub neither. Here's my code.
$errmessage = "file does not exist";
$ftp->put("temp_buffer1.txt")
or die &email($errmessage);
sub email ($errmessage) {
use Mail::Sendmail;
my %mail;
$mail{From} = 'From Me <[email protected]>';
$mail{To} = 'To Me <[email protected]>';
$server = 'smtp1.itas.net';
$mail{Smtp} = $server;
$mail{Subject} = 'Process failure!!';
$mail{Message} = $errmessage;
$mail{Message} = "It was sent on " . Mail::Sendmail::time_to_date() .
"\n";
# Go send it
sendmail %mail
}
Any help would be apprecited.
Chris
I'm doing my best to get through this one. I want to error check on
each part of the FTP process. If it fails I want to call an e-mail
sub. Unfortunately the FTP process prints an error and as such my
script fails. For some reason I also can't pass the appropriate error
message to the e-mail sub neither. Here's my code.
$errmessage = "file does not exist";
$ftp->put("temp_buffer1.txt")
or die &email($errmessage);
sub email ($errmessage) {
use Mail::Sendmail;
my %mail;
$mail{From} = 'From Me <[email protected]>';
$mail{To} = 'To Me <[email protected]>';
$server = 'smtp1.itas.net';
$mail{Smtp} = $server;
$mail{Subject} = 'Process failure!!';
$mail{Message} = $errmessage;
$mail{Message} = "It was sent on " . Mail::Sendmail::time_to_date() .
"\n";
# Go send it
sendmail %mail
}
Any help would be apprecited.
Chris