diff --git a/lib/SENDMAIL/sendemail.cpp b/lib/SENDMAIL/sendemail.cpp index b84e1fbaa..ab2c90ecd 100755 --- a/lib/SENDMAIL/sendemail.cpp +++ b/lib/SENDMAIL/sendemail.cpp @@ -40,7 +40,8 @@ bool SendEmail::send(const String& from, const String& to, const String& subject DEBUG_EMAIL_PORT.println(port); #endif -#ifndef ARDUINO_ESP8266_RELEASE_2_4_2 +#if defined(ARDUINO_ESP8266_RELEASE_2_3_0) || defined(ARDUINO_ESP8266_RELEASE_2_4_2) +#else client->setInsecure(); bool mfln = client->probeMaxFragmentLength(host.c_str(), port, 512); #ifdef DEBUG_EMAIL_PORT @@ -51,6 +52,7 @@ bool SendEmail::send(const String& from, const String& to, const String& subject } #endif + if (!client->connect(host.c_str(), port)) { #ifdef DEBUG_EMAIL_PORT diff --git a/lib/SENDMAIL/sendemail.h b/lib/SENDMAIL/sendemail.h index f622fb4e1..394612fc6 100755 --- a/lib/SENDMAIL/sendemail.h +++ b/lib/SENDMAIL/sendemail.h @@ -18,14 +18,14 @@ class SendEmail const int timeout; const bool ssl; const int auth_used; -#ifndef ARDUINO_ESP8266_RELEASE_2_4_2 +#if defined(ARDUINO_ESP8266_RELEASE_2_3_0) || defined(ARDUINO_ESP8266_RELEASE_2_4_2) + WiFiClient* client; +#else // use bear ssl // #include "WiFiClientSecureLightBearSSL.h" // BearSSL::WiFiClientSecure_light *client; - //BearSSL::WiFiClientSecure* client; - WiFiClientSecure* client; -#else - WiFiClient* client; + BearSSL::WiFiClientSecure* client; + //WiFiClientSecure* client; #endif String readClient(); void a3_to_a4(unsigned char * a4, unsigned char * a3);