How can I send an email message from within a VBScript script?

If you have Microsoft IIS with SMTP installed on a server, you can use the following code to send a basic email message from within a script:

Set objMessage = CreateObject(“CDO.Message”)
objMessage.Subject = “Subject”
objMessage.Sender = “ali@alibutt.com”
objMessage.To = “you@yourself.com”
objMessage.TextBody = “test mail”
objMessage.Send

Leave a Reply

Your email address will not be published. Required fields are marked *