'==========================================================================
'
' NAME: SendMail.vbs
'
' AUTHOR: Mark D. MacLachlan , The Spider's Parlor
' URL: [URL unfurl="true"]http://www.thespidersparlor.com[/URL]
' DATE : 4/2/2007
' COPYRIGHT (c) 2007 All Rights Reserved
'
' COMMENT:
'
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
' ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED To
' THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
' PARTICULAR PURPOSE.
'
' IN NO EVENT SHALL THE SPIDER'S PARLOR AND/OR ITS RESPECTIVE SUPPLIERS
' BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
' DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
' WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
' ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
' OF THIS CODE OR INFORMATION.
'
'==========================================================================
' What address do you want to be seen in the From field
oFrom = "Passwordmanager@company.com"
' Set the SMTP server IP
oMyIP = "192.168.16.2"
' Where do you want the message to be delivered
oTo = "administrator@company.com"
' Set the visual basic constants as they do not exist within VBScript.
' Do not set your smtp server information here.
Const cdoSendUsingMethod = "[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/sendusing",[/URL] _
cdoSendUsingPort = 2, _
cdoSMTPServer = "[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/smtpserver"[/URL]
'Create the CDO connections.
Dim iMsg, iConf, Flds
Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
Set Flds = iConf.Fields
'SMTP server configuration.
With Flds
.Item(cdoSendUsingMethod) = cdoSendUsingPort
'Set the SMTP server address here.
.Item(cdoSMTPServer) = oMyIP
.Update
End With
'Set the message properties.
With iMsg
Set .Configuration = iConf
.To = oTo
.From = oFrom
.Subject = "Password Reset"
.TextBody = "Your password was reset " & Now
End With
'An attachment can be included.
'iMsg.AddAttachment logfile
'Send the message.
iMsg.Send
WScript.Quit