TransBind
asked on
DTS Package email does not send
I am trying to send an email using DTS Package. I created db connection, execute sql task and an active x script task, the source code for the active x script is below. When i run the dts package it completes without any problems but i never receive an email. What are possible reasons for me not to receive an email? Cdonts r not set up correctly?
active x script task is run on success of execute sql task
'************************* ********** ********** ********** ********** *****
' Visual Basic ActiveX Script
'************************* ********** ********** ********** ********** *******
Function Main()
On Error Resume Next
dim strEmailBody
dim objMail
'add Larry to this list for a final version
'should email upon success of synchronizing CP records
const EXECUTIVE_EMAILS = 'mail@xxxxx.com'
set objMail = CreateObject('CDONTS.NewMa il')
strEmailBody = 'Status Report:' & vbCrLf & _
'Downstream synchronization ' & _
'of data has completed successfully. '
objMail.To = EXECUTIVE_EMAILS
objMail.Subject = 'Synch Down Status Report (Success)'
objMail.Importance = 2 'High
objMail.Subject = strEmailBody
objMail.Send
if err.count = 0 then
Main = DTSTaskExecResult_Success
else
Main = DTSTaskExecResult_Failure
end if
End Function
active x script task is run on success of execute sql task
'*************************
' Visual Basic ActiveX Script
'*************************
Function Main()
On Error Resume Next
dim strEmailBody
dim objMail
'add Larry to this list for a final version
'should email upon success of synchronizing CP records
const EXECUTIVE_EMAILS = 'mail@xxxxx.com'
set objMail = CreateObject('CDONTS.NewMa
strEmailBody = 'Status Report:' & vbCrLf & _
'Downstream synchronization ' & _
'of data has completed successfully. '
objMail.To = EXECUTIVE_EMAILS
objMail.Subject = 'Synch Down Status Report (Success)'
objMail.Importance = 2 'High
objMail.Subject = strEmailBody
objMail.Send
if err.count = 0 then
Main = DTSTaskExecResult_Success
else
Main = DTSTaskExecResult_Failure
end if
End Function
What version of SQL Server?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
But to answer your question consider removing the following line:
On Error Resume Next
And you may have a better chance of trouble-shooting the problem.
On Error Resume Next
And you may have a better chance of trouble-shooting the problem.