Well, it should not crash in the first place. Please ensure to set the job to run detached so it cannot bring down other stuff. If you want you can add Ping before MailSend to check if the server computer is available or PingPort with SMTP port 21 to ensure the email server is running. Something like Dim ping_status, boolean Ping "my server name or IP", ping_status If ping_status, SEND_EMAIL, HANDLE_ERRORS SEND_EMAIL: MailSend .... so on.. Exit HANDLE_ERRORS: ... write here what to do if email server ciould not be reached : I have hit upon a problem sending mail when on the : rare occasion the mail server is down. : My Jal script sends a mail somewhere within, : the same script creates a semaphore file on : successful completion of the job. : If the SendMail fails due to the unavailability of : the mail server the job crashes at that point and : does not create a semaphore file. : Is there anyway of trapping a sendmail error to ensure : a controlled flow of script execution in the event of : the mail server being down? : Thank you.
|