My first post, so please pardon any faux-pas...
I'm building an Arduino Mega2560 based application (with W5100 ethernet shield) for my water system. It reads conductivity, water levels etc, which for now it displays on a TFT and on a webpage. It also needs to send emails, in case some of the levels fall outside of normal operation.
I successfully implemented the TFT and the webserver from the Examples in Arduino IDE, using fixed IP (Ethernet.begin(mac, IP))... getting readings as supposed.
I'm also successfully sending emails through smtp2go, using their sketch. This one uses Ethernet.begin(mac), relying on a DHCP server. it also works.
Here's the problem:
As long as I use Ethernet.begin(mac) to operate in DHCP mode, both the server and the emailing seems to work.
If I use Ethernet.begin(mac, IP), SMTP2GO's email server refuses to connect (client.connect(emailServer, port) = 0).
I've been looking at https://forum.arduino.cc/index.php?topic=134966.0, about Client and server running at the same time. The "server" code is essentially identical to what I'm using, but the "client" is different enough, that I can't make the connection (no pun intended).