Contact Info

Crumbtrail

ActiveXperts.com » Administration » VBScript Collection » Messaging and Communication » SMTP Mail

SMTP Mail Scripts

Send Email without Installing the SMTP Service
Send Email from a Script


You can use any of the VBScript programs below in ActiveXperts Network Monitor. Click here for an explanation about how to include scripts in ActiveXperts Network Monitor.



Send Email without Installing the SMTP Service


Demonstration script that uses CDO to send email from a computer where the SMTP Service has not been installed. Replace the name smarthost with the name of your SMTP server.
Set objEmail = CreateObject("CDO.Message")

objEmail.From = "admin1@fabrikam.com"
objEmail.To = "admin2@fabrikam.com"
objEmail.Subject = "Server down" 
objEmail.Textbody = "Server1 is no longer accessible over the network."
objEmail.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objEmail.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _
        "smarthost" 
objEmail.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objEmail.Configuration.Fields.Update
objEmail.Send
	

Send Email from a Script


Demonstration script that uses CDO to send email from a computer where the SMTP Service has been installed.
Set objEmail = CreateObject("CDO.Message")

objEmail.From = "monitor1@fabrikam.com"
objEmail.To = "admin1@fabrikam.com"
objEmail.Subject = "Atl-dc-01 down" 
objEmail.Textbody = "Atl-dc-01 is no longer accessible over the network."
objEmail.Send