?
Solved

mail dynamic ip

Posted on 2005-03-17
21
Medium Priority
?
183 Views
Last Modified: 2010-05-02
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
Comment
Question by:nschwend
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
21 Comments
 

Author Comment

by:nschwend
ID: 13563576
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
 
LVL 29

Expert Comment

by:nffvrxqgrcfqvvc
ID: 13564302
Correct me if I am wrong but do you have any means of visual basic or must this be in script format?
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:nschwend
ID: 13564341
it would be better if it's in script format because in not so good in programming...
0
 
LVL 29

Expert Comment

by:nffvrxqgrcfqvvc
ID: 13564407
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
 
LVL 29

Expert Comment

by:nffvrxqgrcfqvvc
ID: 13564422
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
 
LVL 29

Expert Comment

by:nffvrxqgrcfqvvc
ID: 13564442
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
 
LVL 29

Expert Comment

by:nffvrxqgrcfqvvc
ID: 13564463
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
 

Author Comment

by:nschwend
ID: 13564549
i tried your script but it gives me always 0 IP founds....

why it doesn't work?
0
 
LVL 29

Expert Comment

by:nffvrxqgrcfqvvc
ID: 13564573
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
 
LVL 29

Expert Comment

by:nffvrxqgrcfqvvc
ID: 13564672
'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
 

Author Comment

by:nschwend
ID: 13564748
The problem is that I have Outlook 2003... I cannot use Outlook Express...
0
 
LVL 29

Expert Comment

by:nffvrxqgrcfqvvc
ID: 13564754
Did you try it?
0
 

Author Comment

by:nschwend
ID: 13564807
I have no account in OE...

0
 
LVL 29

Expert Comment

by:nffvrxqgrcfqvvc
ID: 13564823
I know but it might work for outlook 2003, if you just try it see if it works.
0
 

Author Comment

by:nschwend
ID: 13564958
no, nothing works... it gives me no error but I don't get any email.......
0
 
LVL 29

Expert Comment

by:nffvrxqgrcfqvvc
ID: 13565092
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
 

Author Comment

by:nschwend
ID: 13565261
for me it's important that I can schedule it and obtain my ip address... I don't care about language...

0
 
LVL 29

Accepted Solution

by:
nffvrxqgrcfqvvc earned 2000 total points
ID: 13565518
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
 

Author Comment

by:nschwend
ID: 13565623
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
 
LVL 8

Expert Comment

by:jkorz
ID: 13568605
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month9 days, 20 hours left to enroll

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question