Hi,
I like to send email from a host that may not have SMTP service installed. I try the following sample code from Microsoft website and it does not work. I may miss some configuration here. Please take a look and let me know how to make it work.
Here is my goal: I need to be able to send email from a workstation that has Internet connction. This action is either time-interval driven or event driven. I tried the following without success yet.
1. Send email from a script with SMTP service installed:
http://www.microsoft.com/technet/scriptcenter/scripts/default.mspx?mfr=trueSet objEmail = CreateObject("CDO.Message"
)
objEmail.From = "monitor@mycorp.com"
objEmail.To = "admin@mycorp.com"
objEmail.Subject = "Atl-dc-01 down"
objEmail.Textbody = "Atl-dc-01 is no longer accessible over the network."
objEmail.Send
I save the above code as send-mail1.vbs and run it from a XP machine with SMTP service started. It did not run into any error but I did not receive this email either.
Q#1.1 Without specifying a real SMTP server, how does the script know how to send it out?
Q#1.2 How to 'trace' the test email so I know where the problem is?
2. Send email without SMTP service installed:
http://www.microsoft.com/technet/scriptcenter/scripts/default.mspx?mfr=trueSet objEmail = CreateObject("CDO.Message"
)
objEmail.From = "monitor@mycorp.com"
objEmail.To = "admin@mycorp.com"
objEmail.Subject = "Server down"
objEmail.Textbody = "Server1 is no longer accessible over the network."
objEmail.Configuration.Fie
lds.Item _
("
http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objEmail.Configuration.Fie
lds.Item _
("
http://schemas.microsoft.com/cdo/configuration/smtpserver") = _
"smarthost"
objEmail.Configuration.Fie
lds.Item _
("
http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objEmail.Configuration.Fie
lds.Update
objEmail.Send
I save the above code as email-no-smtp.vbs and run it from the same XP workstation. It run into error on line#15: The transport failed to connect to the server.
Q#2.2: What kind of (remote) server do I need if I do not have SMTP service installed on the local machine?
Q#2.3: Any such servers available (for free)? I guess there should be very few. Otherwise the spammers could take advantage of them.
Q#3. Do you have any other solution to achieve my goal?
Thanks a lot.
Start Free Trial