-
Hi, I discovered your useful lib yesterday via randomnerdtutorials. I now use it for a Pir Monitor and noticed the sending of the first mail after boot is very slow. Cheers, |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
Are you new to networking? It is about the networking (on-line) task, instead of off-line task, and you have to wait. You have to setup WiFi and wait until it connected. |
Beta Was this translation helpful? Give feedback.
-
Thanks for your quick reply!
Not really. I wrote a mail client on a unix box about 35 years ago. I agree with what you say above, but I can (and do) connect to wifi at boot, not at first mail sent. In my code I do a smtp connect/sendMail/closeSession for every mail, because time between sends can be hours. No need to maintain a connection. Sending the second and following mails is fast enough this way. So what I am asking for is this: when sending the first mail there are necessary steps to do that are not needed for following mails. (How) can I do these steps separately at boot, without actually sending a mail. |
Beta Was this translation helpful? Give feedback.
-
Great, this did it: now sending the first mail is just as fast as the following mails. |
Beta Was this translation helpful? Give feedback.
Library checks for valid time from your device i.e. from ESP32/ESP8255 timer before sending message. If it was not valid time based on default timestamp, NTP server time requesting will begin.
You don't have to do anything for preparing if your WiFi network and system time are ok.
As I said the SMTP server negotiation takes time just only during message sending.