dreniarb Posted February 9, 2005 Share Posted February 9, 2005 Been looking for something like this for a few years now. Never could find a "simple" program to alert me when a customer's ip address changes. I think this is about as simple as it gets (until Autoit has it's own built in smtp engine that is). Got the idea from Wb-Freekill's PCinfo script.Forum topicBasically, it checks the file wanip.txt (created after first use of the script) and stores the ip address found in it. It then checks whatismyip.org for the ip address, and plugs it into wanip.txt. If the ip's are the same, it exits. If they're different, it uses blat to send an email with the contents of wanip.txt (the ip address).$To = IniRead(@Homedrive & "wanip.ini", "Settings", "To", "") $From = IniRead(@Homedrive & "wanip.ini", "Settings", "From", "") $SMTP = IniRead(@Homedrive & "wanip.ini", "Settings", "SMTP", "") $Site = IniRead(@Homedrive & "wanip.ini", "Settings", "Site", "") $FILE = FileOpen(@Homedrive & "wanip.txt", 0) $LINE1 = FileReadLine($FILE) $IP = URLDownloadToFile ($Site, @Homedrive & "wanip.txt") $FILE = FileOpen(@Homedrive & "wanip.txt", 0) $LINE = FileReadLine($FILE) FileClose(@Homedrive & "wanip.txt") If $Line1 = $Line Then Exit Else RunWait(@ComSpec & " /c " & 'blat wanip.txt -to ' & $To & ' -f ' & $From & ' -server ' & $SMTP, "", @SW_HIDE) EndIfHere's the wanip.ini file format:[Settings] smtp=mail.server.com site=http://whatismyip.org to=you@yourdomain.com from=anynamehere@nottooimportant.comYou need blat in the same folder as the script and ini file:BlatTo get around needing authentication on the mail server, I used my own mail server (the one that hosts my email). Since the email is going to an account on it, it doesn't ask for authentication (ie, it's not trying to relay).I'd like to have blat use a different subject. It's not necessary, but it would just look nicer. But when I try to put in a subject (-subject "Here's my new ip"), it won't email. Maybe autoit doesn't like the quotes?Let me know what you guys think or if any of the code could be tightened up. I hope some of you out there find this useful. Link to comment Share on other sites More sharing options...
sshrum Posted February 19, 2005 Share Posted February 19, 2005 (edited) Nice one.I actually wrote the same thing (sorta) in PHP. Supports DNS registering, FTP, and email.Check this out:http://www.shrum.net/code/?body=./wan2web/home.html Odd...I called my log file wanip.txt too FYI: I just noticed the http://whatismyip.org...I've been hosting my own WAN IP display at http://www.shrum.net/getip.php Edited February 19, 2005 by sshrum bootlesnet 1 Sean Shrum :: http://www.shrum.net All my published AU3-based apps and utilities 'Make it idiot-proof, and someone will make a better idiot' Link to comment Share on other sites More sharing options...
bootlesnet Posted March 5, 2016 Share Posted March 5, 2016 can you share me this file getip.php sshrum?! thank you! Link to comment Share on other sites More sharing options...
argumentum Posted March 6, 2016 Share Posted March 6, 2016 On 3/5/2016 at 0:38 PM, bootlesnet said: can you share me this file getip.php sshrum?! thank you! well, in 2005 ... ok, anyway, here "http://stackoverflow.com/questions/13646690/how-to-get-real-ip-from-visitor" and as far as that, I'd use STUN_GetMyIP() =) Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
bootlesnet Posted March 7, 2016 Share Posted March 7, 2016 12 hours ago, argumentum said: well, in 2005 ... ok, anyway, here "http://stackoverflow.com/questions/13646690/how-to-get-real-ip-from-visitor" and as far as that, I'd use STUN_GetMyIP() =) I Know that's very old, thank for your help argumentum 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now