mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2026-05-10 16:05:52 +00:00
rename mail -> email
This commit is contained in:
@@ -115,7 +115,8 @@ bool System::command_send(const char * value, const int8_t id) {
|
||||
return EMSESP::txservice_.send_raw(value); // ignore id
|
||||
}
|
||||
|
||||
bool System::command_sendmail(const char * value, const int8_t id) {
|
||||
// send email via SMTP
|
||||
bool System::command_sendemail(const char * value, const int8_t id) {
|
||||
bool enabled = false;
|
||||
bool ssl, starttls;
|
||||
uint16_t port;
|
||||
@@ -135,8 +136,8 @@ bool System::command_sendmail(const char * value, const int8_t id) {
|
||||
if (!enabled) {
|
||||
return false;
|
||||
}
|
||||
LOG_DEBUG("Command sendmail port %d%s called with '%s'", port, ssl ? " (SSL)" : starttls ? " (STARTTLS)" : "", value);
|
||||
// LOG_DEBUG("Command sendmail port %d called with '%s'", port, value);
|
||||
LOG_DEBUG("Command sendemail port %d%s called with '%s'", port, ssl ? " (SSL)" : starttls ? " (STARTTLS)" : "", value);
|
||||
// LOG_DEBUG("Command sendemail port %d called with '%s'", port, value);
|
||||
bool success = false;
|
||||
|
||||
#ifndef NO_TLS_SUPPORT
|
||||
@@ -150,10 +151,10 @@ bool System::command_sendmail(const char * value, const int8_t id) {
|
||||
ssl_client->setBufferSizes(1024, 1024);
|
||||
r_client->addPort(port, starttls ? readymail_protocol_tls : ssl ? readymail_protocol_ssl : readymail_protocol_plain_text);
|
||||
|
||||
// smtp->connect(server, port, sendmailCallback);
|
||||
// smtp->connect(server, port, sendemailCallback);
|
||||
smtp->connect(server, port);
|
||||
if (!smtp->isConnected()) {
|
||||
LOG_ERROR("Sendmail connection error");
|
||||
LOG_ERROR("send email connection error");
|
||||
delete smtp;
|
||||
delete r_client;
|
||||
delete ssl_client;
|
||||
@@ -164,7 +165,7 @@ bool System::command_sendmail(const char * value, const int8_t id) {
|
||||
// LOG_INFO("authenticate %s:%s", login.c_str(), pass.c_str());
|
||||
smtp->authenticate(login, pass, readymail_auth_password);
|
||||
if (!smtp->isAuthenticated()) {
|
||||
LOG_ERROR("Sendmail authenticate error");
|
||||
LOG_ERROR("send email authentication error");
|
||||
delete smtp;
|
||||
delete r_client;
|
||||
delete ssl_client;
|
||||
@@ -1080,7 +1081,7 @@ void System::commands_init() {
|
||||
Command::add(EMSdevice::DeviceType::SYSTEM, F_(read), System::command_read, FL_(read_cmd), CommandFlag::ADMIN_ONLY);
|
||||
Command::add(EMSdevice::DeviceType::SYSTEM, F_(send), System::command_send, FL_(send_cmd), CommandFlag::ADMIN_ONLY);
|
||||
Command::add(EMSdevice::DeviceType::SYSTEM, F_(fetch), System::command_fetch, FL_(fetch_cmd), CommandFlag::ADMIN_ONLY);
|
||||
Command::add(EMSdevice::DeviceType::SYSTEM, F_(sendmail), System::command_sendmail, FL_(sendmail_cmd), CommandFlag::ADMIN_ONLY);
|
||||
Command::add(EMSdevice::DeviceType::SYSTEM, F_(sendemail), System::command_sendemail, FL_(sendemail_cmd), CommandFlag::ADMIN_ONLY);
|
||||
Command::add(EMSdevice::DeviceType::SYSTEM, F_(restart), System::command_restart, FL_(restart_cmd), CommandFlag::ADMIN_ONLY);
|
||||
Command::add(EMSdevice::DeviceType::SYSTEM, F_(format), System::command_format, FL_(format_cmd), CommandFlag::ADMIN_ONLY);
|
||||
Command::add(EMSdevice::DeviceType::SYSTEM, F_(txpause), System::command_txpause, FL_(txpause_cmd), CommandFlag::ADMIN_ONLY);
|
||||
|
||||
Reference in New Issue
Block a user