cancel
Showing results for 
Search instead for 
Did you mean: 

Sending an Email in case of error in Joblog.

0 Kudos

Hi All,

I am trying to send an Email notification when there is an error in any job. Using the below script i am able to push the error info to the log. i need the same to be passed through Email, whenever i get an error in jobs. Can some one help me in this regard.

thisErr = uGetErrorInfo();

uErrMsg(3, "Got error - " + thisErr.getName());

attr = thisErr.firstAttr();

// In this example, we'll just dump all attributes to the log

while (attr != null)

{

attrName = attr.getKey();

attrValue = attr.getValue();

uErrMsg(0, attrName + "=" + attrValue);

attr = thisErr.nextAttr();

Regards,

Dileep

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member2987
Active Contributor
0 Kudos

Acham,

You can use the uSendSMTP() function to send the same information you pass in uErrMsg().

Documentation for this function is in the help file. Note that a mail server connection is required.

BR,

Matt

0 Kudos

Hi,

Thank you very much for your reply. I am able to send the error details directly to the Email.

Thanks,

Dileep