• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 184
  • Last Modified:

mail dynamic ip

hello everybody,
I have a problem... my isp give me a dynamic IP which changes every 20 hours... I'm behind a router so with ipconfig I can only see my LAN address... I want to get an email everytime it changes, to permit me to access my PC from remote...

how can I do that? thank you a lot

Nick
0
nschwend
Asked:
nschwend
1 Solution
 
nschwendAuthor Commented:
they are really nice, but I have to schedule my vbs and none of them I can create or have a txt to use as message body...
0
 
nffvrxqgrcfqvvcCommented:
Correct me if I am wrong but do you have any means of visual basic or must this be in script format?
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
nschwendAuthor Commented:
it would be better if it's in script format because in not so good in programming...
0
 
nffvrxqgrcfqvvcCommented:
arAddresses = GetIPAddresses()
msgbox ubound(arAddresses)+1 & " IP Address(es) found"
for each ip in arAddresses
  msgbox ip
next


Function GetIPAddresses()
'=====
' Returns array of IP Addresses as output
' by ipconfig or winipcfg...
'
' Win98/WinNT have ipconfig (Win95 doesn't)
' Win98/Win95 have winipcfg (WinNt doesn't)
'
' Note: The PPP Adapter (Dial Up Adapter) is
' excluded if not connected (IP address will be 0.0.0.0)
' and included if it is connected.
'=====
  set sh = createobject("wscript.shell")
  set fso = createobject("scripting.filesystemobject")

  Set Env = sh.Environment("PROCESS")
  if Env("OS") = "Windows_NT" then
    workfile = fso.gettempname
    sh.run "%comspec% /c ipconfig > " & workfile,0,true
  else
    'winipcfg in batch mode sends output to
    'filename winipcfg.out
    workfile = "winipcfg.out"
    sh.run "winipcfg /batch" ,0,true
  end if
  set sh = nothing
  set ts = fso.opentextfile(workfile)
  data = split(ts.readall,vbcrlf)
  ts.close
  set ts = nothing
  fso.deletefile workfile
  set fso = nothing
  arIPAddress = array()
  index = -1
  for n = 0 to ubound(data)
    if instr(data(n),"IP Address") then
      parts = split(data(n),":")
      if trim(parts(1)) <> "0.0.0.0" then
        index = index + 1
        ReDim Preserve arIPAddress(index)
        arIPAddress(index)= trim(cstr(parts(1)))
      end if
    end if
  next
  GetIPAddresses = arIPAddress
End Function
0
 
nffvrxqgrcfqvvcCommented:
You could make your script run as a Scheduled Task to Execute the script every 10 minutes.

Example: Have 2 scripts 1 To execute to the script that gets the ip and sends the e-mail

Script 1: contains the ip address and sending the mail

Script2: simply executes script1,script 2 would be the filename place in a scheduled task.
0
 
nffvrxqgrcfqvvcCommented:
Well maybe not every 10 minutes but every 20 hours and 10 minutes, I mean if you absolutley sure it changes every 20 hours on the dot each and every time, then you can just schedule the task for 20 hours and 10 minutes.
0
 
nffvrxqgrcfqvvcCommented:
I would also suggest making sure you set the scheduled task almost immediatly after the ipchanges so it would be in sync with the changing of the ip address. every 20 hours
0
 
nschwendAuthor Commented:
i tried your script but it gives me always 0 IP founds....

why it doesn't work?
0
 
nffvrxqgrcfqvvcCommented:
hmm...Copy and paste all of it into a text file and save it as ip.vbs when u save it make sure you add "ip.vbs" to it so it saves it as  a .vbs file
0
 
nffvrxqgrcfqvvcCommented:
'This is not very good but it works if you have an outlook express account
''''''''''

Try this


Set WshShell = WScript.CreateObject("WScript.Shell")
    WshShell.AppActivate "explore"
    WshShell.Run "iexplore", 9
    Wscript.Sleep 6000
    WshShell.SendKeys "^o"
    Wscript.Sleep 1000
    WshShell.SendKeys "http://whatismyip.com"
    Wscript.Sleep 1000
    WshShell.SendKeys "{ENTER}"
    Wscript.Sleep 3000
    WshShell.SendKeys "^a"
    Wscript.Sleep 1000
    wshShell.SendKeys "%t"
    Wscript.Sleep 1000
    wshShell.SendKeys "{Right}"
    Wscript.Sleep 100
    wshShell.SendKeys "{Down}"
    Wscript.Sleep 100
    wshShell.SendKeys "{Down}"
    Wscript.Sleep 100
    wshShell.SendKeys "{Down}"
    Wscript.Sleep 100
    WshShell.SendKeys "{ENTER}"
    Wscript.Sleep 5000
    'Change for your email address *****
    WshShell.SendKeys "technicalsupport@glennsoftware.com"
    '***************************************
    '     ***
    Wscript.Sleep 1000
    WshShell.SendKeys "%s"
    wscript.sleep 4000
    'Send and ALT-F4 to Close the program
    WshShell.Sendkeys "%{F4}"
    Wscript.Quit
0
 
nschwendAuthor Commented:
The problem is that I have Outlook 2003... I cannot use Outlook Express...
0
 
nffvrxqgrcfqvvcCommented:
Did you try it?
0
 
nschwendAuthor Commented:
I have no account in OE...

0
 
nffvrxqgrcfqvvcCommented:
I know but it might work for outlook 2003, if you just try it see if it works.
0
 
nschwendAuthor Commented:
no, nothing works... it gives me no error but I don't get any email.......
0
 
nffvrxqgrcfqvvcCommented:
Well if you don't want to use a vbscript I already made a project that sends e-mail, I can easily add it to send the IP address, but this is for visual basic. I recommend using visual basic to do these tasks instead of vbscript.
0
 
nschwendAuthor Commented:
for me it's important that I can schedule it and obtain my ip address... I don't care about language...

0
 
nffvrxqgrcfqvvcCommented:
Please go here to download my e-mailer using MAPI controls.

Its the whole project,

A few things you need to do is this..

Change the email address to your e-mail address which is text1, so the email will send you the IP address along witht the host name.

If you need any assistant just ask.

http://www.glennsoftware.com/htmlbin/oe.html
0
 
nschwendAuthor Commented:
at the moment I cannot download the source... You are really kind... this evening I will download it... thank you again and again and again...

Nick
0
 
jkorzCommented:
writing a program to do this is reinventing the wheel

go to www.dynu.com and get a free subdomain that points to your ip address.  It has a little service that you install that will send ip updates to their server and redirect accordingly.
MUCH EASIER than having to check your email every time!!!!!!!!!

i've been using it for years and rd would be a pain without it
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now