@Dilbert I have updated the files on Git today, they can be manually added as a library
To give you an idea of what its doing, it takes the serverName, connects to Google’s DNS, resolves the IP, and returns the IP into remote_addr. your function then uses remote_addr to pass to the TCPclient. because its already an IP address it doesn’t need to look it up.
in the online build page you can add tabs, there is a little plus up the top right. you will need to create a set of tabs (it adds *.cpp and *.h) name them “DNSclient” then add another set of tabs and call them “myUDP” once thats done you can delete just the “myUDP.cpp” as you don’t need it.
in the Git page linked to above there are 3 folders… example, inc and src. Copy and paste the text from DNSclient.cpp in the src folder into your new tab with the same name. then do the same for “DNSclient.h” and “myUDP.h” in the inc folder
When you add the tabs it will automatically add two lines -> “#include DNSclient.h” and “#include myUDP.h” you need to delete just the “#include myUDP.h” the other one is needed
Before the setup function you need to add:
At the top of your SendEmail function add this:
and change this
if (client.connect("api.pushingbox.com", 80)==true)
if (client.connect(remote_addr, 80)==true)
The DNSclient will try 3 times if it cant connect the first time, the number can be changed on line 160 of DNSclient.cpp
Also each loop has a 5sec timeout… the time out can be changed on line 276 of DNSclient.cpp