Home › Forums › The libraries hosted on the site › EMailSender send email with attachments › SMTP server to use with the EMailSender library › EmailSender and SMTP DATA error! SMTP Response TIMEOUT!
Tagged: Arduino, EMailSender, SMTP error timeout
- This topic has 8 replies, 2 voices, and was last updated 1 year, 8 months ago by
Gilles.
-
AuthorPosts
-
-
12 May 2023 at 10:02 #25673
Hello, I use the Email Sender library with Mega Arduinos with mail provider laposte.net and gmail.com (via SendGrid), both on SMTP 587.
I try each time to send an email 4 times (tests stop if resp.code=0) once with laposte.net, once with SendGrid, once with laposte.net and the last with SenGrid.
I sometimes have during attempts to send emails a resp.code = 1 with the message SMTP DATA error! SMTP Response TIMEOUT 4 times in a row!
So if the problem that generated the request to send an email is still present at the next check, I start 4 tries again and so on, if an email goes well, I don’t send any more for 24 hours.
My problem is that despite the error message:
SMTP DATA error! SMTP Response TIMEOUT!
I receive an email (not 4 emails but 1email), despite resp.code =1….
It’s an email from SendGrid (gmail.com) that ended up working and it drowns me in emails (one every 6 minutes or so).
What is SMTP DATA error! SMTP Response TIMEOUT! and how to fix it?My internet connection works well (I test it via a connection to Google)
Here is what my error log looks like:
6/5/2023 14:16:33 1, SMTP DATA error! SMTP Response TIMEOUT!
6/5/2023 14:17:3 -1, 395, = connected Google
6/5/2023 14:17:34 1, SMTP DATA error! SMTP Response TIMEOUT!
6/5/2023 14:18:4 -1, 395, = connected Google
6/5/2023 14:18:5 1, SMTP DATA error! SMTP Response TIMEOUT!
6/5/2023 14:18:36 -1, 395, = connected Google
6/5/2023 14:19:6 1, SMTP DATA error! SMTP Response TIMEOUT!And I received an email at 2:17 p.m. via SendGrid (Gmail.com)
THANKS -
16 May 2023 at 09:14 #25743
Hi Gilles,
please enable debug and send me the result.
Bye Renzo -
21 May 2023 at 21:23 #25864
Sorry, I didn’t see your reply.
The debug is permanently activated but you need a PC connected to the Arduino and my Arduinos are in use on my apiary…
And in addition this error does not seem systematic..
I’ll put my dev hive back in my desktop and see if I can reproduce the problem to save the debug.
I’ll let you know.
THANKSOf course it works now…
To be continued!
THANKS -
24 May 2023 at 08:33 #25872
Hi,
if the problem isn’t systematic you must check your network if there are some latency that put in timeout the request.
The library work or does not work, if you have this problem sometime you must find It in the execution environment.Bye Renzo
-
24 May 2023 at 08:57 #25875
Ok thank you, I am however wired in Ethernet, but it is true that when that does not work it is all the Arduinos at the same time which seem to have this problem!
But since I have the same program in each Arduino, I was thinking more of a software problem…
Is there a way to increase the waiting time (in case of network issues)?
THANKS
-
20 June 2023 at 14:01 #26343
Hello, still with my problem of sending attachments with SendGrid…
Sendgrid told me to test this:
https://stackoverflow.com/questions/2730055/why-would-a-csv-attachment-appear-as-text-in-the-body
basically set content-type to:
application/octet-stream;
I found in the file line 737 this:
client.println(F(“Content-Type: Multipart/mixed; boundary=frontier”));
I tested with client.println(F(“Content-Type:application/octet-stream; boundary=frontier”));
but that didn’t change anything…
Is it here or somewhere else in your library that we can determine Content-type?THANKS
-
9 August 2023 at 15:08 #27080
Hello, I finally managed to reproduce the error code 235, SMTP AUTH error (502-5.5.2 Error: command not recognized)
I don’t have more information per story despite this error I do receive an email…
Do you have an idea?
THANKS -
9 August 2023 at 16:34 #27081
I wonder if resp.code as well as resp.desc that must be deleted between 2 calls to emailsender…is updated between 2 calls to the emailsender function?
Indeed the code 235 comes from a 1st test with laposte.net which no longer works (passage to ssl) then the 2nd test which works is done with sendgrid returns me the same error code although the email be well sent….
If I put in 1st test with sendgrid I have well resp.code =0 and not 235….Is this an error on my part or a bug?
THANKSEMailSender::Response resp = emailSend.send(arrayOfEmail, nb_Recipient_Mail, message); // we send the email via la poste.net numtest=numtest-1; // we just did one more test we decrement if (resp.code == "0") { // we have just succeeded in sending mail returnmail = 0; // sets retourmail to 0 reboot = 0; //we have an internet connection so we reset reboot return (returnmail); // returns the return valuemail 0 } // it's good we exit by returning the value 0 while(nbessai > 0){ // as long as we have chosen to do a test we start again if (resp.code != "0"){ //start another attempt to send emails delay(20000); // we wait 20 seconds before trying again during this time we do nothing.... testconnection(); // we test the internet connection via google if (nbtry % 2 == 0) { //to go into the loop only once out of 2 (nb even) if (monitor == 1){Serial.println(F("send with sengrid")); } EMailSender::Response resp = emailSend2.send(arrayOfEmail, nb_Recipient_Mail, message); // we send the email } else { if (monitor == 1){Serial.println(F("send with post"));} EMailSender::Response resp = emailSend.send(arrayOfEmail, nb_Recipient_Mail, message); // we send the email } numtest = numtest-1; // we just did one more test...
-
This reply was modified 1 year, 9 months ago by
Gilles.
-
This reply was modified 1 year, 9 months ago by
-
6 September 2023 at 11:36 #27313
I wonder if resp.code as well as resp.desc should not be reset to zero between 2 calls to emailsender… between 2 calls to the emailsender function?
Has anyone tested this?
THANKS
-
-
AuthorPosts
- You must be logged in to reply to this topic.