Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > FTP error checking- call e-mail sub

Reply
Thread Tools

FTP error checking- call e-mail sub

 
 
Nex_s
Guest
Posts: n/a
 
      08-04-2005

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 <>';
$mail{To} = 'To Me <>';
$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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Death To Sub-Sub-Sub-Directories! Lawrence D'Oliveiro Java 92 05-20-2011 06:50 AM
Recognising Sub-Items and sub-sub items using xslt Ben XML 2 09-19-2007 09:35 AM
sun.net.ftp.FtpProtocolException: Error reading FTP pending reply long990802@gmail.com Java 3 12-11-2005 02:46 AM
FTP error checking- call e-mail sub Nex_s Perl Misc 1 08-08-2005 07:45 AM
Net::FTP problems getting files from Windows FTP server, but not Linux FTP Server. D. Buck Perl Misc 2 06-29-2004 02:05 PM



Advertisments