When I add some libraries it looks like this, both includes are green, the ESP8266WiFi is in red but the ESP8266SMTP is black. It compiles but does not run, when the smtp functions are called. How to fix or repair?
Thanks
The color of words in the Arduino IDE is controlled by keywords.txt files. The library author can chose to put any words they like in there to be highlighted. Some library authors do this, some try to do it but don't read the documentation so it doesn't work, some start to do it but then forget to keep it updated so only some of the keywords are defined, and some don't bother to do it at all. To make matters worse, the Arduino IDE highlights every keyword from every library you have installed, regardless of whether the library is used by the sketch. So you can sometimes end up with a strange patchwork of coloration. For this reason, it's best to not put too much importance on the color of things in the Arduino IDE.
Keyword highlighting is purely cosmetic. What you're seeing is simply a result of the ESP8266SMTP keyword not being present in a keywords.txt file. It has absolutely nothing to do with the problem you're having. So please ignore the color of these words and look elsewhere to find the cause of your problem.
OK, thanks, first time I have encountered this so wondered. Without the ESP8266SMTP.h the board complies and runs, but with just the library installed and no related code it says it is the wrong board. I don't see how it can be?
Tom
You will need to set up your google account to allow less secure app access.
I experienced some sort of conflict with SdFat library and the esp8266 (lolin D1) with core 2.7.4. For some reason the compiler would include the library from the sketch folder SdFat.h instead of the library from the esp8266 core ESP8266SdFat.
Multiple libraries were found for "SdFat.h"
Used: C:\Users\me\Documents\Arduino\libraries\SdFat
Not used: C:\Users\me\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\libraries\ESP8266SdFat
I had to remove SdFat from my library folder in the sketches folder for the code to compile.
This was not required with the ESP32 Dev Module which appears to use SD.h and uses the version in the esp core and not from the general Arduino libraries.