How to get ip address have have email sent out?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • scotter86
    New Member
    • Aug 2008
    • 21

    How to get ip address have have email sent out?

    Hi everyone, I've been having a hard time with this one... All I'm trying to do is have someone click a batch file that will get their IP address and email it to me, that simple.

    So far I have a batch file called GetIP.bat that contains
    Code:
    cscript getip.js
    And a javascript file that contains
    Code:
    var request = new ActiveXObject("Msxml2.XMLHTTP"); 
    var notyetready = 1; 
    
    request.onreadystatechange=function() 
    { 
    if(request.readyState==4) 
    { 
    WScript.Echo(request.responseText); 
    notyetready = 0; 
    } 
    } 
    
    request.open( "GET", "http://www.whatismyip.com/automation/n09230945.asp", true ); 
    request.send(null); 
    
    while( notyetready ) 
    { 
    WScript.Sleep( 100 ); 
    }
    I just want the IP address to get sent out. I plan on having variables contain the to:,from:, and subject:. I guess what I'm asking is can a javascript file just send an email without having to use a form to post it? If that makes any sense...

    TIA
    Last edited by Dormilich; Jan 4 '11, 06:00 PM. Reason: fitting title to content
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Well, you don't need a form to send an email, but you will need some server-side script/code to send it. JavaScript can make a request to that file/page to send the email.

    Comment

    • scotter86
      New Member
      • Aug 2008
      • 21

      #3
      Thanks for the reply acoder, but yeah, that's kind of my problem. My specific scenario is with a grandparent who you could say is less than able to navigate to get her IP so I can remote in and help.

      I'm looking for something built into widows that could do this because the less I have to alter the better. However, I can install some kind "server" software to enable this, but I'm attempting to eliminate as many vulnerabilities as I can.

      I just want an icon on the desktop she can click to send her info because the dynamic IP presents issues. But she's running an up to date version of XP, so is there some component of XP that can do this for me? Like I said, if not I'm not opposed to some third party software, but I'm looking for as lightweight as possible.

      Any ideas?

      Comment

      • JKing
        Recognized Expert Top Contributor
        • Jun 2007
        • 1206

        #4
        Click Start
        Click Run
        Type cmd
        Hit Enter
        Type ipconfig
        Hit Enter
        Record IP address
        type exit
        Hit Enter

        Comment

        • scotter86
          New Member
          • Aug 2008
          • 21

          #5
          Right, but shes behind a router so her private IP is no good. I already have a batch to pull her routeable from whatsmyip.com, I just need something to send it out that I can call from the same batch without her having to do anything too involved.

          Comment

          • JKing
            Recognized Expert Top Contributor
            • Jun 2007
            • 1206

            #6
            What about a batch file to send an email through outlook?

            Comment

            • scotter86
              New Member
              • Aug 2008
              • 21

              #7
              That could work actually, I'll see what I can find on doing that.

              Comment

              Working...