SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
SendMail

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
SendMail
Author Message
Lionel Sharon



Joined: 19 Dec 2001
Posts: 16

Post SendMail Reply with quote

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.

Fri Jun 02, 2006 4:36 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7970

Post Re: SendMail Reply with quote

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.

Fri Jun 02, 2006 9:25 am View user's profile Send private message
Lionel Sharon



Joined: 19 Dec 2001
Posts: 16

Post Re: SendMail Reply with quote

Thank you.

: 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

Fri Jun 02, 2006 2:44 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.