Jump to content

I want to automate an alert email if an event occurs


Recommended Posts

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

Link to comment
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>

Link to comment
Share on other sites

  • 2 weeks later...

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.

Link to comment
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

Link to comment
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.

Link to comment
Share on other sites

  • 2 weeks later...

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...