Home › Forums › The libraries hosted on the site › EMailSender send email with attachments › different mail server not connecting
Tagged: EMailSender, STARTTLS, support
- This topic has 2 replies, 1 voice, and was last updated 3 years, 11 months ago by
Edje.
-
AuthorPosts
-
-
24 May 2021 at 12:32 #12350
edje
Hi Mischanti,
first you made a great library thanks for that,
i have been dancing around with this library and probably i can’t seem to get it to work with
a different email server. keep getting could not connect to mail server.i now the server can handle it.(made with a different email sender)
see below:
Sending greeting response…
> C: send smtp command, HELO
< S: 250-8BITMIME
< S: 250-PIPELINING
< S: 250-PIPE_CONNECT
< S: 250-AUTH PLAIN LOGIN
< S: 250-STARTTLS
< S: 250 HELPSend command, STARTTLS
> C: send STARTTLS command
< S: 220 TLS go ahead
> C: performing the SSL/TLS handshakeSending greeting response…
> C: send smtp command, HELO
<
< S: 250-8BITMIME
< S: 250-PIPELINING
< S: 250-PIPE_CONNECT
< S: 250-AUTH PLAIN LOGIN
< S: 250 HELP/* * 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 = "Pannekoek"; const char *password = "stroopensuiker"; uint8_t connection_state = 0; uint16_t reconnect_interval = 10000; //EMailSender (………email_login,email_password,..email_from,……….name_from….., smtp_server, smtp_port ); EMailSender emailSend("tuinalarm@ziggo.nl","12345","tuinalarm@ziggo.nl","tuinalarm@ziggo.nl","smtp.ziggo.nl",587); //void setIsSecure(bool isSecure = false); //void setSASLLogin(bool isSASLLogin = false); 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 = "Soggetto"; message.message = "Ciao come stai<br>io bene.<br>www.mischianti.org"; EMailSender::Response resp = emailSend.send("iemand@gmail.com", message); Serial.println("Sending status: "); Serial.println(resp.status); Serial.println(resp.code); Serial.println(resp.desc); } void loop() { }
can you help???
-
This topic was modified 1 year, 9 months ago by
Renzo Mischianti.
-
This topic was modified 1 year, 9 months ago by
-
24 May 2021 at 17:33 #12354
Hi edje,
I think the problem is that my library not support STARTTLS, and I need a quite bit of time to implement.
You must use standard SSL SMTP server.
Bye Renzo -
24 May 2021 at 18:24 #12355
Edje
Oké thanks,
For your fast reply.
Then i will only use gmail👍
-
-
AuthorPosts
- You must be logged in to reply to this topic.