473,326 Members | 2,110 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

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
Expand|Select|Wrap|Line Numbers
  1. cscript getip.js
  2.  
And a javascript file that contains
Expand|Select|Wrap|Line Numbers
  1. var request = new ActiveXObject("Msxml2.XMLHTTP"); 
  2. var notyetready = 1; 
  3.  
  4. request.onreadystatechange=function() 
  5. if(request.readyState==4) 
  6. WScript.Echo(request.responseText); 
  7. notyetready = 0; 
  8.  
  9. request.open( "GET", "http://www.whatismyip.com/automation/n09230945.asp", true ); 
  10. request.send(null); 
  11.  
  12. while( notyetready ) 
  13. WScript.Sleep( 100 ); 
  14.  
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
Jan 4 '11 #1
6 2723
acoder
16,027 Expert Mod 8TB
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.
Jan 11 '11 #2
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?
Jan 18 '11 #3
JKing
1,206 Expert 1GB
Click Start
Click Run
Type cmd
Hit Enter
Type ipconfig
Hit Enter
Record IP address
type exit
Hit Enter
Jan 18 '11 #4
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.
Jan 19 '11 #5
JKing
1,206 Expert 1GB
What about a batch file to send an email through outlook?
Jan 19 '11 #6
That could work actually, I'll see what I can find on doing that.
Jan 19 '11 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: relaxedrob | last post by:
Howdy All! I must admit that the more I use and learn JavaScript, the more convinced I am that it is one of the most expressive languages I know. Without ways to access file i/o or databases...
4
by: Roger Redford | last post by:
Dear Experts, I'm attempting to marry a system to an Oracle 817 datbase. Oracle is my specialty, the back end mainly, so I don't know much about java or javascript. The system uses javascript...
6
by: nate | last post by:
Hello, Does anyone know where I can find an ASP server side script written in JavaScript to parse text fields from a form method='POST' using enctype='multipart/form-data'? I'd also like it to...
21
by: ryanmhuc | last post by:
I know the subject might be confusing. I am no beginner with javascript but I haven't been able to figure out how to get the javascript file name from code inside the file. So you have an HTML...
34
by: kroger | last post by:
Hi. I am at a loss to decipher why the javascript on my web page: http://www.psych.nmsu.edu/~jkroger/lab/index.html does not display the date correctly in Firefox. Instead of "2005" for the...
5
by: mgershma | last post by:
Hi. Does anybody know how can JavaScript get the filename of the file it's located in? For example, file 'mike.js' contains several functions and variables. I would like to set the variable...
33
by: Simon Brooke | last post by:
I'm working on a system which uses Google maps. I want the user to see a map of more or less where (s)he is in the world when (s)he first comes to the system. So the obvious thing seemed to be to...
6
by: vunet.us | last post by:
I have an HTML page with included JS file like: <script language="javascript" type="text/javascript" src="file.js"></ script> The file.js has a set of functions and global initializer for some...
2
by: Junior | last post by:
Using this syntax: MailTo with multiline message in Body <a href="mailto:astark1@unl.edu?body=The message's first paragraph.%0A%0aSecond paragraph.%0A%0AThird Paragraph."> Works fine, except...
6
by: emirapoport | last post by:
Hello, im posting this question because i have zero knowledge on javascrip. I have a script which curently allows users to imput an email address and if the email is not valid it wont allow the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.