Solved

DTS Package email does not send

Posted on 2006-06-21
4
307 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

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Join & Write a Comment

Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

759 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now