Solved

DTS Package email does not send

Posted on 2006-06-21
4
317 Views
Last Modified: 2013-11-30
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.NewMail')

      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
0
Comment
Question by:TransBind
  • 2
  • 2
4 Comments
 
LVL 20

Expert Comment

by:Sirees
ID: 16951162
What version of SQL Server?
0
 
LVL 20

Assisted Solution

by:Sirees
Sirees earned 100 total points
ID: 16951176
Check that the dll is on the server and that it is registered
0
 
LVL 75

Accepted Solution

by:
Anthony Perkins earned 400 total points
ID: 16951219
Consider the following as a better alternative to CDONTS:

XPSMTP.DLL - SQL Server SMTP Mail XP
http://www.sqldev.net/xp/xpsmtp.htm
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 16951236
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.
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question