mirror of https://github.com/arendst/Tasmota.git
commit
6030501673
|
@ -22,7 +22,7 @@
|
|||
|
||||
#include "my_user_config.h"
|
||||
//#ifdef USE_MQTT_TLS
|
||||
#if defined(USE_MQTT_TLS) || defined (USE_SENDMAIL)
|
||||
#if defined ESP8266 && (defined(USE_MQTT_TLS) || defined (USE_SENDMAIL))
|
||||
|
||||
//#define DEBUG_TLS
|
||||
|
||||
|
|
|
@ -8,7 +8,11 @@
|
|||
#include <base64.h>
|
||||
//#include <core_version.h>
|
||||
|
||||
#ifdef ESP8266
|
||||
#include "WiFiClientSecureLightBearSSL.h"
|
||||
#else
|
||||
#include <WiFiClientSecure.h>
|
||||
#endif
|
||||
|
||||
class SendEmail
|
||||
{
|
||||
|
@ -20,12 +24,17 @@ class SendEmail
|
|||
const int timeout;
|
||||
const bool ssl;
|
||||
const int auth_used;
|
||||
#ifdef ESP8266
|
||||
#if defined(ARDUINO_ESP8266_RELEASE_2_3_0) || defined(ARDUINO_ESP8266_RELEASE_2_4_2)
|
||||
WiFiClient* client;
|
||||
#else
|
||||
// use bear ssl
|
||||
BearSSL::WiFiClientSecure_light *client;
|
||||
#endif
|
||||
#else
|
||||
WiFiClient *client;
|
||||
#endif
|
||||
|
||||
String readClient();
|
||||
void a3_to_a4(unsigned char * a4, unsigned char * a3);
|
||||
int base64_encode(char *output, const char *input, int inputLen);
|
||||
|
|
|
@ -174,12 +174,17 @@ exit:
|
|||
return status;
|
||||
}
|
||||
|
||||
#ifdef ESP8266
|
||||
void script_send_email_body(BearSSL::WiFiClientSecure_light *client);
|
||||
|
||||
|
||||
SendEmail::SendEmail(const String& host, const int port, const String& user, const String& passwd, const int timeout, const int auth_used) :
|
||||
host(host), port(port), user(user), passwd(passwd), timeout(timeout), ssl(ssl), auth_used(auth_used), client(new BearSSL::WiFiClientSecure_light(1024,1024)) {
|
||||
}
|
||||
#else
|
||||
void script_send_email_body(WiFiClient *client);
|
||||
SendEmail::SendEmail(const String& host, const int port, const String& user, const String& passwd, const int timeout, const int auth_used) :
|
||||
host(host), port(port), user(user), passwd(passwd), timeout(timeout), ssl(ssl), auth_used(auth_used), client(new WiFiClientSecure()) {
|
||||
}
|
||||
#endif
|
||||
|
||||
String SendEmail::readClient() {
|
||||
delay(0);
|
||||
|
|
|
@ -4720,7 +4720,13 @@ void ScriptWebShow(void) {
|
|||
|
||||
|
||||
#ifdef USE_SENDMAIL
|
||||
|
||||
#ifdef ESP8266
|
||||
void script_send_email_body(BearSSL::WiFiClientSecure_light *client) {
|
||||
#else
|
||||
void script_send_email_body(WiFiClient *client) {
|
||||
#endif
|
||||
|
||||
uint8_t msect=Run_Scripter(">m",-2,0);
|
||||
if (msect==99) {
|
||||
char line[128];
|
||||
|
|
Loading…
Reference in New Issue