Trouble Sending Email w/ActiveX Script

  • I am trying to send an email with an ActiveX Script but keep getting the error "ActiveX Scripting encountered a Run Time Error during the execution of the script." The reason I am using a script to perform this in DTS instead of the Send Email task is because our DBA does not have MAPI set up on our server, and rather use the SMTP service. My question is whether or not the error is in regards to my code or whether it is an issue with the email service on the server. Please give any advice possible. Here is the code:

    Function Main()

    dim msg

    set msg = CreateObject("CDO.Message")

    msg.From = "SQL_Monitor@BIGSQL"

    msg.To = "brad.davis@huntington.com"

    msg.Subject = "SQL Server Package Failures Report"

    msg.TextBody = "The package failed."

    msg.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mailgw.huntington.com"

    msg.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2

    msg.Configuration.Fields.Update

    msg.Send

    Main = DTSTaskExecResult_Success

    End Function

    Thanks ahead of time.

  • I fixed it. I just had the 'From' email address incorrect.

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

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