| 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
|