Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

srinivasa1
Contributor

Email Notification

Hi

I written  the macro which has been written has been setup to be executed "OnPostReload"  trigger.I have tested it and works fine but the problem is even if script fails it sends an email which we don’t want. script is as bellow.

function SendMessage()


    Set objMessage = CreateObject("CDO.Message")

    objMessage.Subject = "QlikView test message"

    objMessage.From = """ABC D"" <sd@ABC.com>" ' Dummy ID


       strMailTo = "sd@ABC.com;"


       

    strMailTo = left(strMailTo,len(strMailTo)-1) ' remove the last ; in list


    objMessage.To = strMailTo

    objMessage.TextBody = "Test" & vbCRLF & vbCRLF

   
    objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 21

    objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "pobox.ABC.com"

    objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 250

    objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60

    objMessage.Configuration.Fields.Update

objMessage.Send

 

end function

Plese guide me how i can handle in case of Error. i dint want to send mail. thanks in adavance.

Community Browser