Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Auto Email

Status
Not open for further replies.

Finnerbahce

Technical User
Joined
Sep 29, 2005
Messages
12
Location
IE
Hi,

I need to set up a script to send an auto email when x amount of errors occur on a web checker. I have the web checker running but now want to incorporate my email into it. I'm a novice but found markdmac's advice below very handy. I have a few questions though:


What should these be set to?

[quopte]Const cdoSendUsingMethod = " _
cdoSendUsingPort = 2, _
cdoSMTPServer = "[/quote]

Can oFrom be my mail address?
Can oTo be my mail address? or should these both be smtp servers or what?

Any help appreciated.
 
OK Scratch that. I got this working.

Now........

My vbscript tests an internet page. What I want to do is after 5 failures I want a mail to be sent. How can I wrap my code with the 5 failures thingy?
 
This is my current code. How can I change this for a while statement?

if sError <= 50 then
wscript.echo now() & " Test OK"
logfile.writeline now() & " Test OK"
logfile.close
ie.quit
exit do
else

wscript.echo now() & " Test FAILURE"
logfile.writeline now() & " Test FAILURE"
wshshell.run "c:\ringin.bat"
logfile.writeline now() & " Please Investigate."
wshshell.popup "Document failed to load.",15
***Here it will call my sendmail script
createobject("wscript.shell").run "test.bat"
logfile.close
ie.quit

end if
exit do


Also, am I better off hard coding my instuctions or is it the same thing as just calling other vb scripts?
 
Glad you found my other post helpful.

For your current needs, what kind of time frame are you looking for here? I mean if you have this script run forever and you were to get 1 error every 2 hours then in 10 hours you would get a notification, but the site could actually still be up and running.

this can be a lot of work to create a tool that already exists.

You might instead want to take a look at a product like this:

I hope you find this post helpful.

Regards,

Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top