Solved

Send mail from SQL Server 2000 ActiveX Script

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

In this article—a derivative of my DaytaBase.org blog post (http://daytabase.org/2011/06/18/what-week-is-it/)—I will explore a few different perspectives on which week today's date falls within using Microsoft SQL Server. First, to frame this stu…
Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
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.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

747 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

8 Experts available now in Live!

Get 1:1 Help Now