Home > Archive > MS SQL Server DTS > September 2005 > objMessageSend problems in DTS VBscript









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author objMessageSend problems in DTS VBscript
pjames

2005-09-30, 11:23 am

Hi,

I am trying to send a basic smtp message from a DTS package. I am running
SQL Server 2000 on my laptop connecting to the server in the code below. I
have modified the basic code which I found floating all over the internet to
be as follows:

Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "This is new"
objMessage.Sender = "Me.Self@work.com"
objMessage.To = "Me.Self@work.com"
objMessage.TextBody = "Your identity is compromised."
objMessage.AddAttachment "\\mmm-crm- 123\s$\Oppty\sacredf
ile.xls"

objMessage.Configuration.Fields.Item
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objMessage.Configuration.Fields.Item
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "LocalHost"
'objMessage.Configuration.Fields.Item
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25

objMessage.Configuration.Fields.Update
objMessage.Send

When I try this, I get an error "The transport failed to connect to the
server". Now, if I put the exact same code into a text file (test.vbs) and
run the file directly (remote desktop) on the same server, it works
perfectly. I have tried substituting "LocalHost" with server's IP and DNS
identity, but it still fails to connect. On the remote desktop, I am logged
directly into the server using my credentials, and I am an admin on the box.
When I log into SQL Server, I also use my credentials, but I am not sure how
DTS runs on the server. Is there a permission thing that needs to be set for
the SQL Server login on the box?

Thanks for any leads you can provide
Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com