This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Change of IP without notification of mail!
#1
Hi everybody !
I have the following code:
----------------------------------
require('user.mail')
require('socket.http')
socket.http.timeout = 0
http = require('socket.http')
local ip = http.request('http://openrb.com/ip')
local oldip= storage.get('myip')
if (ip~=nil and ip ~= oldip) then
  log("Change my ip=" .. ip ) 
  storage.set('myip', ip)
  mail('panhhvtc@gmail.com','Ctr nha mau 66 ngo thi nham ','IP : '..ip)
end
-----------------------------------
The above code when I ran, it reported an error as shown in the attached image. What is wrong with me? My Gmail is still working fine
Thank so much ! Smile

Attached Files Thumbnail(s)
   
Reply
#2
what FW do you use?
------------------------------
Ctrl+F5
Reply
#3
Use HTTPS. If it still does not work then you have to update firmware to 2019 RC1.
Code:
require('user.mail')
ip = require('ssl.https').request('https://openrb.com/ip')
oldip = storage.get('myip')
if ip and ip ~= oldip then
  log('Change my ip=' .. ip)
  storage.set('myip', ip)
  mail('panhhvtc@gmail.com','Ctr nha mau 66 ngo thi nham ','IP : '..ip)
end
Reply


Forum Jump: