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
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.
THANKS
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.
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)?
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?
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
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?
THANKS
EMailSender::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, 4 months ago by Gilles.
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
Maintaining a repository (or site or forum) is a lot like tending to a garden - it requires constant care and attention to keep it thriving. If you're a skilled gardener (or coder!) and want to help keep our repository blooming, we'd love to have you on board! We're also looking for talented writers and forum moderators to help us grow our community. Interested in joining our team? Don't hesitate to reach out and let us know how you can contribute!
Are you a fan of electronics or programming? Share your knowledge with others, write a simple tutorial or how to make a great project Contact me: share_your_ideas@mischianti.org
The content displayed on this website is protected under a CC BY-NC-ND license. Visitors are prohibited from using, redistributing, or altering any content from this website for commercial purposes, including generating revenue through advertising. Any unauthorized use is a violation of the license terms and legal action may be taken against individuals or entities found to be in violation.
You must also provide the link to the source.
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional
Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional
Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.