DTS Package - Sending Mail

  • Hi Experts,

    I have to send a mail through DTS Package using ActiveX Script. I am using the below script to send an email message to the concern user. But i am getting the following error message.

    Error Code : 0

    Error Description : CDO.Message.1

     

    Code :

    -----------------------------------------------------------------

    '**********************************************************************

    '  Visual Basic ActiveX Script

    '************************************************************************

    Function Main()

     Const cdoSendUsingPickup = 1

     Const SMTP_SERVER = "stp56.qerk.org"

     Const MSG_FROM = """Financial Operations Help Desk"" SJhones@lc.org"

     Const MSG_TO = """Henry Chones"" <hchones@lc.org>"

     'Const MSG_CC = """RElavi"" <relavi@lc.org>"

     Const MSG_SUBJECT = "SM Summit File - Failed"

     Const MSG_BODY = "The SM_SUMMIT_FILE package failed."

     

     set iMsg = CreateObject("CDO.Message")

     set iConf = CreateObject("CDO.Configuration")

     

     Set Flds = iConf.Fields

     

     With Flds

      .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPickup

      .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = SMTP_SERVER

      .Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10

      .Update

     End With

     

     With iMsg

       Set .Configuration = iConf

      .To = MSG_TO

      .Cc = MSG_TO

      .From = MSG_FROM

      .Subject = MSG_SUBJECT & " for " & FormatDateTime(Date())

      .TextBody = MSG_BODY

      .Send

     End With

     Main = DTSTaskExecResult_Success

    End Function

    -----------------------------------------------------------------------

    Can anybody help me sort out this error message ?

     

    Regards

    Karthik

     

    karthik

  • If you are trying this from your office then probably this error could be because of Mail Exchange Server. System Administrators will stop relays in the Exchange server to prevent JUNK emails in the organisation.

Viewing 2 posts - 1 through 1 (of 1 total)

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