NodeMCU: OTA + Telnet + Adafruit IO + Email Sender

Hello,
I have a NodeMCU that I have successfully got to work with OTA, Telnet, and Adafruit IO. However, I cannot get it to send emails through gmail. I have a separate program that I am able to send emails through without any issues, but when I try to combine the two programs together, I keep getting an SMTP error.

The base of the program is to read an analog value from a humidity sensor and send that value to Adafruit IO. The concept is that if that value gets too high (i.e. water detected), it will send an email to me.

Working_sketch_OTA_AIO.ino and config.h work as is to upload to Adafruit IO, access to telnet and OTA programming.

What doesn't work is:
NON_WORKING.ino with config.h, Gsender.cpp and Gsender.h

However, if I make a simple program without OTA, Telnet, and Adafruit IO, I can get Gsender to work.

Thoughts??

NON_WORKING.ino (11.9 KB)

Gsender.h (1.23 KB)

Gsender.cpp (3.46 KB)

Working_sketch_OTA_AIO.ino (11.4 KB)

config.h (2.99 KB)

Found a way to get it to work instead it uses Adafruit IO MQTT. Will upload sketch when it is finished in a few days.