[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

DTS Package email does not send

Posted on 2006-06-21
4
Medium Priority
?
332 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 400 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 1600 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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
An alternative to the "For XML" way of pivoting and concatenating result sets into strings, and an easy introduction to "common table expressions" (CTEs). Being someone who is always looking for alternatives to "work your data", I came across this …
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
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

650 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