Solved

Send mail from SQL Server 2000 ActiveX Script

Posted on 2013-05-11
2
450 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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Suggested Solutions

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…
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

828 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