How to send an Email when the DTS Fails

  • Hi .. I have Couple of DTS packages that sheduled everyday .... I want to update these Packages as

    these packages need to send an email for a group of mailId's ..If the package is failed ..

    Please can anyone explain .. how can i do this

  • On Job Failure, run the following script against the master database.

    exec master..xp_smtp_sendmail

    @from=N'Email address from where the message is sent',

    @to =N'Email address to whom the message needs to be sent',

    @subject =N'XYZ JOB FAILED',

    @message =N'XYZ JOB FAILED',

    @server =N'Relay Server IP',

    @type =N'text/html'

  • Hi .. thanks for reply .. Is there any other way .. Because My Server is not updated with Service pack ..

    there is no map.dll file .. Which we can't update right now .. is there anyother ay to get email from DTS when the DTS fails to Run ...

  • Please correct me if i am wrong :

    using ActiveX Script ...

    Function Main()

    Set objMessage = CreateObject("CDO.Message")

    objMessage.Subject = "Message"

    objMessage.From = "john@abc.com"

    objMessage.To = "john@abc.com"

    objMessage.TextBody = "Executed Successfully"

    objMessage.Send

    Main = DTSTaskExecResult_Success

    End Function

    Working Fine ... ..

  • That will work. You could also use a Send Mail task in DTS if you have MAPI on the server.

    Greg

  • Hi .. thanks for reply ...

    Please can any one tell me ...

    Is there any process to send an email by using activeX which mentioned above ..

    When a single step fails need to send an email .. like ..

    i have a package with number of steps for example Step a, b,c,d ..

    and Step e is the ActiveX task which send when the package is success..

    and want to include one more activex which send email when the job fails..

    Just want to know if any of the Step a,b,c,d fails .. need to get failure message ... it should not pass to success message ...

    thanks

    John

  • John Paul-702936 (3/3/2010)


    Hi .. thanks for reply ...

    Just want to know if any of the Step a,b,c,d fails .. need to get failure message ... it should not pass to success message ...

    Just add a failure workflow from the steps to an ActiveX Script task that sends a "failed" message.

    Greg

  • Thanks ..

  • How Can we Setup a Email notification , When the Scheduled Job Fails ..

Viewing 9 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply