Solved

Send mail from SQL Server 2000 ActiveX Script

Posted on 2013-05-11
2
449 Views
Last Modified: 2013-05-15
Hi all.

I want to send a simple email from a SQL Server 2000 DTS.

I get the following error: "The transport failed to connect to the server"
Error on line 23.

Is there something wrong with the script? Should I enable something on the server?
Function Main()

   Set objMessage = CreateObject("CDO.Message") 
    objMessage.Subject = "Testing" 
    objMessage.From = "myemail@abc.com" 
    objMessage.To = "myemail@gmail.com"

    objMessage.TextBody = "Sample Text" 
  

    objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 

    'Name or IP of Remote SMTP Server
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "192.168.22.3"

    'Server port (typically 25)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 

    objMessage.Configuration.Fields.Update

    objMessage.Send
    Main = DTSTaskExecResult_Success
End Function

Open in new window

0
Comment
Question by:Sim1980
2 Comments
 
LVL 35

Expert Comment

by:David Todd
ID: 39159882
Hi,

Do you have a mapi client on the server? That is, generally you need to install outlook or something similar, and setup a profile under the SQL Server service account for SQL 2000 to work to email.

HTH
  David
0
 
LVL 2

Accepted Solution

by:
dhlotter earned 500 total points
ID: 39160705
Alternatively, you can try something like database mail for SQL 2000.

http://www.sqlservercentral.com/articles/SQL+Server+2000/69475/
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
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
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

823 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