Link to home
Start Free TrialLog in
Avatar of TechsupportAbility
TechsupportAbilityFlag for United States of America

asked on

VBS Backup Message Notification

I have a Backup script written in VBS that we want to give to one of our employees in Payroll to run whenever he needs it done. In order to monitor it on our end we want it to send a message to our Network Admin either through a command prompt or an email whenever it is run.

I myself am not very familiar with VB, the code we are using is open source and I just changed a few things to fit with our needs.

If anyone has any ideas as to what I should try out I'd greatly appreciate it.
Avatar of astroviper
astroviper

Could send an email if you have a mail server on your network that supports it.

Set objMessage = CreateObject("CDO.Message")
objMessage.MimeFormatted = True
objMessage.From = "Mr. Someone <anyuser@wherever.com>" 
objMessage.To = "destination@there.com
objMessage.Subject = "subject here"
objMessage.HTMLBody = "body html here"
 
 
'==This section provides the configuration information for the remote
'== SMTP server. Normally you will only change the server name or IP.
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 
'Name or IP of Remote SMTP Server
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mailserver ip"
'Server port (typically 25)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 
objMessage.Configuration.Fields.Update
'==End remote SMTP server configuration section==
 
objMessage.Send

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of astroviper
astroviper

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of TechsupportAbility

ASKER

This worked perfectly. Thank you very much for you help!