I know there are a lot of examples available for sending e-mail from vbscript but they all seem to involve using an SMTP relay or creating an Outlook.Application object.
I can't use either of these methods. I simply want to us a CDO.Message object with an Exchange server on my domain.
I have a book that makes this sound like the simplest thing in the world, but it doesn't seem to contain all the code needed to connect to the Exchange server, so I get an error.
This is the example code I am trying to get working.
After several seconds pass, the .Send line generates this error.
The transport failed to connect to the server.
Code: 80040213
Source: CDO.Message.1
Any clues as to my missing code would be appreciated.
I can't use either of these methods. I simply want to us a CDO.Message object with an Exchange server on my domain.
I have a book that makes this sound like the simplest thing in the world, but it doesn't seem to contain all the code needed to connect to the Exchange server, so I get an error.
This is the example code I am trying to get working.
Code:
Set objEmail = CreateObject("CDO.Message")
With objEmail
.From = "myemail@mydomain.com"
.To = "myemail@mydomain.com"
.Subject = "Automagical Email"
.Textbody = "You have received email from a mystical wizard! You gain 37 exp. You find: soiled loincloth"
.Send
End With
Set objEmail = Nothing
After several seconds pass, the .Send line generates this error.
The transport failed to connect to the server.
Code: 80040213
Source: CDO.Message.1
Any clues as to my missing code would be appreciated.