help please – smtp error: 503 Bad sequence of commands
thanks for the help in advance !!!
where is the problem here?
why is the void setPublicIpDescriptor(const char *publicIpDescriptor = "mymailde"); part not taken?
Where does this need to be placed in the code?
18:58:11.100 -> Connection: ESTABLISHED
18:58:11.100 -> Got IP address: 192.168.1.131
18:58:11.100 -> ONLY ONE RECIPIENTInsecure client:0
18:58:11.199 -> MFLN supported: yes
18:58:12.628 -> 220 kundenserver.de (mreue010) Nemesis ESMTP Service ready
18:58:12.628 -> HELO mischianti:
18:58:12.761 -> 503 Bad sequence of commands
18:58:12.761 -> Sending status:
18:58:12.761 -> 0
18:58:12.761 -> 250
18:58:12.761 -> Identification error (503 Bad sequence of commands )
/*
* EMailSender library for Arduino, esp8266 and esp32
* Simple esp8266 Gmail send example
*
* http://mischianti.org/category/my-libraries/emailsender-send-email-with-attachments/
*
*/
#include "Arduino.h"
#include <EMailSender.h>
#include <ESP8266WiFi.h>
const char* ssid = "xxx";
const char* password = "xxx";
uint8_t connection_state = 0;
uint16_t reconnect_interval = 10000;
// you can set post constructor
//
// void setIsSecure(bool isSecure = true);
void setUseAuth(bool useAuth = true);
void setPublicIpDescriptor(const char *publicIpDescriptor = "mymailde");
// EMailSender emailSend("smtp.account@gmail.com", "password");
// EMailSender(const char* email_login, const char* email_password, const char* email_from, const char* name_from, const char* smtp_server, uint16_t smtp_port );
// EMailSender(const char* email_login, const char* email_password, const char* email_from, const char* smtp_server, uint16_t smtp_port);
// EMailSender(const char* email_login, const char* email_password, const char* email_from, const char* name_from );
// EMailSender(const char* email_login, const char* email_password, const char* email_from);
// EMailSender(const char* email_login, const char* email_password);
// müssen Sie in den SMTP-Servereinstellungen den Port von 465 auf 587 ändern und die Verschlüsselung von SSL/TLS auf STARTTLS umstellen
EMailSender emailSend("myxxx@mail.de", "xxx", "myxxx@mail.de", "smtp.ionos.de", 465);
uint8_t WiFiConnect(const char* nSSID = nullptr, const char* nPassword = nullptr)
{
static uint16_t attempt = 0;
Serial.print("Connecting to ");
if(nSSID) {
WiFi.begin(nSSID, nPassword);
Serial.println(nSSID);
}
uint8_t i = 0;
while(WiFi.status()!= WL_CONNECTED && i++ < 50)
{
delay(200);
Serial.print(".");
}
++attempt;
Serial.println("");
if(i == 51) {
Serial.print("Connection: TIMEOUT on attempt: ");
Serial.println(attempt);
if(attempt % 2 == 0)
Serial.println("Check if access point available or SSID and Password\r\n");
return false;
}
Serial.println("Connection: ESTABLISHED");
Serial.print("Got IP address: ");
Serial.println(WiFi.localIP());
return true;
}
void Awaits()
{
uint32_t ts = millis();
while(!connection_state)
{
delay(50);
if(millis() > (ts + reconnect_interval) && !connection_state){
connection_state = WiFiConnect();
ts = millis();
}
}
}
void setup()
{
Serial.begin(115200);
connection_state = WiFiConnect(ssid, password);
if(!connection_state) // if not connected to WIFI
Awaits(); // constantly trying to connect
EMailSender::EMailMessage message;
message.subject = "Email Status TEST";
message.message = "Ciao come stai<br>io bene.<br>LG homa";
EMailSender::Response resp = emailSend.send("myxxx@mail.de", message);
Serial.println("Sending status: ");
Serial.println(resp.status);
Serial.println(resp.code);
Serial.println(resp.desc);
}
void loop()
{
}