Solved

DTS Package email does not send

Posted on 2006-06-21
4
323 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free eBook: Backup on AWS

Everything you need to know about backup and disaster recovery with AWS, for FREE!

Question has a verified solution.

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

In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

724 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