You are on page 1of 1

function SendErrorEmail(strErrCode, strErrMsg) { var bsOutboundCommMgr = TheApplication().GetService("Outbound Communications Ma nager"); var psInputs = TheApplication().

NewPropertySet(); var psOutputs = TheApplication().NewPropertySet(); var MyFile = Clib.fopen('c:\\SendErrorEmail.txt', 'at'); Clib.fputs('Successfully Started. ', MyFile); var CommProfile = "azhang"; var MsgToList = "azhang@samplecorp.com"; var MsgBody = "Error: " + strErrCode + ": " + strErrMsg; var MsgSubject = "Siebel: Error Occurred for Updating Missing Global IDs"; psInputs.SetProperty("CommProfile",CommProfile); //for web client use 'Remote' instead of 'Local' psInputs.SetProperty("ProcessMode","Local"); psInputs.SetProperty("MsgToList",MsgToList); psInputs.SetProperty("MsgBody",MsgBody); psInputs.SetProperty("MsgSubject",MsgSubject); inputs.SetProperty("AttachFileList",AttachFileList); Clib.fputs('Successfully instantiated service and property sets. ', MyFile); try { bsOutboundCommMgr.InvokeMethod("SendMessage",inputs,outputs); } catch (e) { if (defined(e.errText)) { Clib.fputs('An exception occurred. ' + 'Error: ' + e.ErrText + 'Stack: ' + e.toString(), MyFile); } else { Clib.fputs('An exception occurred in the ' + this.Name() + 'Object. ' + 'Error: ' + e.ErrText + 'Stack: ' + e.toString(), MyFile); } } finally { Clib.fclose (MyFile); psInputs = null; psOutputs = null; bsOutboundCommMgr =null; } }