Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Send mail from SQL Server 2000 ActiveX Script

Posted on 2013-05-11
2
Medium Priority
?
461 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 2000 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
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 …
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

688 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