Home › Forums › The libraries hosted on the site › EMailSender send email with attachments › Send a simple mail including the value of a declared variable in the message
- This topic has 4 replies, 3 voices, and was last updated 4 years, 6 months ago by
Renzo Mischianti.
-
AuthorPosts
-
-
2 July 2020 at 01:58 #4849
Mario Sabransky
Good morning people!
I am new in Arduino word and I am using with great success the EmailSender library.
Thanks a lot for your work!
Now I am not success trying to send the value of a variable obtained from the Esp8266 sketch using the simple email sender. (my project do not have SD support).
I need to send a message with a welcome text (like your examples), but including the value of a variable from the sketch routine.
Could someone help me?
Thank you very much and have a nice time.
Greetings.
Mario
-
3 July 2020 at 07:51 #4885
Hi Mario,
I put a piece of my Inverter monitor where I send a set of value via mail when there is a problem
EMailSender::EMailMessage message;
const String sub = F("Inverter error!"); // Here the subject
message.subject = sub;
const String mp = F("Error on inverter centraline");
const String ft = (fixedTime)?F("OK"):F("NO");
const String sd = (sdStarted)?F("OK"):F("NO");
const String wc = (wifiConnected)?F("OK"):F("NO");
const String sf = (isFileSaveOK)?F("OK"):F("NO");
// Here the message in html format
message.message = mp+
F("<br>Time fixed: ")+ft+
F("<br>SD Initialized: ")+sd+
F("<br>Wifi Connecter :P: ")+wc+
F("<br>Saving file ok: ")+sf+
F("<br>Wrong saving attempts: ")+sdWrongReadNumber
;
EMailSender::Response resp = emailSend.send(emailToSend, message);
The result isError on inverter centraline
Time fixed: OK
SD Initialized: OK
Wifi Connecter :P: OK
Saving file ok: NO
Wrong saving attempts: 10
Bye Renzo
Attachments:
You must be logged in to view attached files. -
4 July 2020 at 19:03 #4923
Hi Renzo.
Thank you very much for your clear and didactic example.
It has allowed me to understand in a minute how to solve my problem.
At the same time, it helps me to see in which area should I focus my study.
I am very excited.
Have a nice day. -
31 October 2020 at 09:16 #7475
Hi Renzo
can you tell me What type of this variable is ( sdWrongReadNumber ) in this code or send to me the code ,
Because I am trying to send, via email, a variable that contains a number, but I was not able, so I tried a byte variable, and also, did it work, because the program considered the code wrong
thank you very much
-
31 October 2020 at 09:50 #7478
Hi Mohammed,
I use this declaration
uint8_t sdWrongReadNumber = 0;
You can find the complete sketch of the Power One aurora Inverter at this link.
GitHub repository of ABB Aurora inverter web interface.
If you need more info, ask.
Bye Renzo
-
-
AuthorPosts
- You must be logged in to reply to this topic.