Script to get IP address and send email every so often

  1. jimbo45's Avatar
    Posts : 11,012
    Windows / Linux : Arch Linux
       #1

    Script to get IP address and send email every so often


    Hi there

    any decent programmers out there who can generate a script for me that does the following :

    1) Get my IP address
    2) send an email say every 30 mins (or user settable) to a FIXED email address - or even a text to a mobile phone.

    The reason I want this is that services like no-Ip are going "PAY FOR" or you get some silly restrictions on the free stuff like re-register every few days or the IP address detection program runs every minute which is a nonsense --with Fibre connections to your ISP the IP address doesn't change much (if at all) while you are connected to the Internet - but only at boot.

    That way I can access my home computer without needing to get a commercial domain etc -- on the LOCAL LAN the server has a fixed IP address so port forwarding isn't a problem for using things like RDP.

    Please don't suggest TEAMVIEWER -- don't want or need it. My upload speed on ISP is perfectly good enough for me to be independent of this type of service.

    Even if you run say an apache (LAMP / WAMP) server you will get access to it easily enough via its IP address of you know it.

    Surprised some of the experienced coders out there haven't done this type of thing. Should be easy enough to issue a command to get your external IP address (Router gives you that without even needing Internet access from the HOST) , push the output say to a notepad file and then send email with the notepad attachment.

    I'm not a coder --I know what to do --but not how to do it !! so any help there would be fine --don't care if it's C, C++, VB or anything so long as it works !!

    Cheers
    jimbo
      My Computer

  2. BunnyJ's Avatar
    Posts : 22,741
    Windows 10 Home x64
       #2

    Give me some time and I'll look into this today. I need to do some things first today.. like waking up.

    I'll try it out in both VB.Net and AutoIt. I need to install .Net back on my PC and that will take an hour or so,.

    Jeff
    Last edited by BunnyJ; 02 May 2016 at 06:20. Reason: Added content...
      My Computer

  3. jimbo45's Avatar
    Posts : 11,012
    Windows / Linux : Arch Linux
    Thread Starter
       #3

    BunnyJ said:
    Give me some time and I'll look into this today. I need to do some things first today.. like waking up.

    I'll try it out in both VB.Net and AutoIt.

    Jeff
    Hi there

    @Bunny

    For Linux there's a simple command that returns your IP address (external)

    dig +short myip.opendns.com @ReSolver1.opendns.co


    This though seems to work for Windows

    run this command as a normal user

    Script to get IP address and send email every so often-ip.png

    the major problem now is to generate an email (in Batch) or a message to a mobile phone
    capturing linux output from the console is easy -- however I'm using OUTLOOK in Windows for email --Linux email clients still UGH UGH !!.

    Cheers
    jimbo
    .
      My Computer

  4. BunnyJ's Avatar
    Posts : 22,741
    Windows 10 Home x64
       #4

    It's really shouldn't be that hard to get this done with either VB or AutoIt.

    I'll PM you later on with more information.
      My Computer

  5. jimbo45's Avatar
    Posts : 11,012
    Windows / Linux : Arch Linux
    Thread Starter
       #5

    BunnyJ said:
    It's really shouldn't be that hard to get this done with either VB or AutoIt.

    I'll PM you later on with more information.
    Hi there

    Thanks !!!

    Cheers
    jimbo
      My Computer

  6. cereberus's Avatar
    Posts : 12,629
    Windows10
       #6

    I use this organisation that does not time out, and you can set up "dial home" interval.

    http://www.freedns.afraid.org

    I actually set up my raspberry pi to basically call ddns server every so often and update my external ip address.

    I can't remember exactly how I did it but these links give more info.

    https://freedns.afraid.org/scripts/freedns.clients.php

    This gives some windows clients as well, but I just leave my pi on 24/7, and I have never had a problem

    TechJawab.com: Setup Dynamic DNS / DynDNS for *FREE* on Raspberry Pi / Ubuntu

    Now with bash on Insider versions .......
      My Computer



 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 03:13.
Find Us




Windows 10 Forums