SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
Register Now and get your question answered!
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 ActiveX Scripting encountered a Run Time Error dur
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Posting Yak Master

110 Posts

Posted - 11/29/2011 :  13:22:24  Show Profile  Reply with Quote

I am using an ActiveX script task in my dts package and this has worked for years. However since a week I get the following message just when the send function is called:

ERROR: ActiveX Scripting encountered a Run Time Error during the execution of the script.

Function Main()
    Main = DTSTaskExecResult_Success
End Function

Function SendEmail()
    Dim dt 
    dt = Date
    dim CurrentDate 
    CurrentDate = Month(dt) & "/" & Day( dt ) & "/" & Year(dt)

    Set objMessage = CreateObject("CDO.Message") 
    objMessage.Subject = CurrentDate
    objMessage.From = "xx@xx.net" 
    objMessage.To = "xx@xx.net"  
    objMessage.HTMLBody  = CurrentDate

    '==This section provides the configuration information for the remote SMTP server.
    '==Normally you will only change the server name or IP.
    objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 

    'Type of authentication, NONE, Basic (Base64 encoded), NTLM
    objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1

    'Use SSL for the connection (False or True)
    objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False

    'Name or IP of Remote SMTP Server
    objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "xx.xx.net"

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

    'Your password on the SMTP server
    objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "xx"

    'Server port (typically 25)
    objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 


End Function 

Edited by - sonu on 11/29/2011 13:22:54
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000