Solved

Send mail from SQL Server 2000 ActiveX Script

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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
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…
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

626 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