Testai la funzione per rilevare l'IP pubblico del modem ed inviarlo via mail ad un account di Libero con esito positivo, di seguito il listato.
' ********************************************************************
' ***** File Info *****
' ********************************************************************
' Filename: ESP12_PROVA_MAIL_publicIP
' Date : 25/12/2017
' Version : 00
' Edit. by: Ma.La.
' Function: send e-mail public IP,
' Firmware: ESP Basic 3.0.Alpha 69
' Hardware: ESP8266-12e (nodeMCU)
' ********************************************************************
cls
memclear
pubip = wget(myip.dnsomatic.com) 'get public IP
locip = ip() 'get local IP
wprint "LocIP: " & locip & " ----- PubIP: " & pubip
print
Button "Send MAIL",[sendmail]
button "quit", [quit]
wait
[sendmail]
strBody = "Il mio IP pubblico: " & pubip
'setupemail {server}, {port}, {user name}, {password}
setupemail "smtp.libero.it", 25, "esp_mario@libero.it", "MiaPassword"
'email {String To email}, {String From Email}, {String Subject}, {String Body}
email "esp_mario@libero.it", "esp_mario@libero.it", "My public IP", strBody
[quit]
timer 0
cls
wprint |<a href="../edit">[EDIT]</a>|
wprint " "
wprint |<a href="../run">[RUN]</a>|
wprint " "
wprint |<a href="../settings">[SETTINGS]</a>|
end
wait
buona fortuna