Sign in to follow this  
Followers 0
computergroove

I want to automate an alert email if an event occurs

10 posts in this topic

I have a restaurant owner who had 6 registers and there is an employee who is unplugging one of the terminals so they can steal money. The installation is on a peer to peer network where there are 6 windows xp pro terminals and a server xp pro server. I want to run a script from the server to the ip address of the computer that keeps getting unplugged and when it becomes disconnected I want an email sent to me immediately. I am browsing through the autoit functions and I cannot see a smtp option to use in a script. Has anyone made a program like this or is there any info on sending an email to a gmail account from the script?


Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Share this post


Link to post
Share on other sites



Another idea is to install video cameras to actually catch them in the act. A script that alerts you by email that a computer network connection is unplugged is not very good evidence.


#include <ByteMe.au3>

Share this post


Link to post
Share on other sites

From the Help file:

<autoit>#include <INet.au3>

$s_SmtpServer = "mysmtpserver.com.au"

$s_FromName = "My Name"

$s_FromAddress = "From eMail Address"

$s_ToAddress = "To eMail Address"

$s_Subject = "My Test UDF"

Dim $as_Body[2]

$as_Body[0] = "Testing the new email udf"

$as_Body[1] = "Second Line"

$Response = _INetSmtpMail ($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body)

$err = @error

If $Response = 1 Then

MsgBox(0, "Success!", "Mail sent")

Else

MsgBox(0, "Error!", "Mail failed with error code " & $err)

EndIf

</autoit>

Share this post


Link to post
Share on other sites

Will this work without a password from the email account in Gmail?


Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Share this post


Link to post
Share on other sites

No. Gmail would need a password. Jos's example should work for Gmail. I would also look into using SMS. The same function can be used to send a txt message to his phone. The owner would most likely recive a txt quicker then an email.

Share this post


Link to post
Share on other sites

No. Gmail would need a password. Jos's example should work for Gmail. I would also look into using SMS. The same function can be used to send a txt message to his phone. The owner would most likely recive a txt quicker then an email.

How do I send a txt message from an autoit script?


Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Share this post


Link to post
Share on other sites

How do I send a txt message from an autoit script?

The same way you send an email. You just need to know the persons cell service provider. For example if his provider is verizon, the email address you would send the txt to would be ##########@vtext.com. The "###" being his phone number. Check out the UDF below. It has like every provider address you can think of.

Share this post


Link to post
Share on other sites

You can use a loop with PING and when the ping fails, it sends you an email

Share this post


Link to post
Share on other sites

agree with powercat, simple and efficient.


-- Arck System _ Soon -- Ideas make everything

"La critique est facile, l'art est difficile"

Projects :

[list] [*]Au3Service : Run your exe as service V3 / Updated 29/07/2013 Get it Here [/list]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0