Email Notification When MCU goes offline

Hello team, i hope everything is ok.
I’m new here using Blynk Community as well the Blynk Solution.
I’m able to configure my blynk app and the sketch to send email when the hardware come online, an app notification when the software goes offline and online, but i dont know how to do the same but sending an email when the hardware goes offline (Power failure or internet disconnection)
Another thing how can i use a second email for notification? tried 2 accounts gmail and hotmail. Gmail received the email notification but the hotmail account never arrived the message (Neither in the spam folder). What i did was add an extra line for the second email like this:
Blynk.email("XXXXXXX@gmail.com", “Control de Luces en Linea”, “Controlador listo para encender o apagar luces de la casa.”);
Blynk.email("XXXXXXX@hotmail.com", “Control de Luces en Linea”, “Controlador listo para encender o apagar luces de la casa.”);

Here is my code without the extra line for the second email notification:

#define BLYNK_PRINT Serial // Comment this out to disable prints and save space
#include <SPI.h>
#include <WiFi101.h>
#include <BlynkSimpleMKR1000.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = “9444c5088772401e80359a386ec5cace”;

// Your WiFi credentials.
// Set password to “” for open networks.
char ssid[] = “(Multicolor) 2016”;
char pass[] = “XXXXXXXX”;

void setup()
{
Serial.begin(9600);
Blynk.begin(auth, ssid, pass);
// Or specify server using one of those commands:
//Blynk.begin(auth, ssid, pass, “blynk-cloud.com”, 8442);
//Blynk.begin(auth, ssid, pass, server_ip, port);

while (Blynk.connect() == false) {
// Wait until connected
}

// Send e-mail when your hardware gets connected to Blynk Server
// Just put the recepient’s “e-mail address”, “Subject” and the “message body”
Blynk.email("XXXXXXX@gmail.com", “Control de Luces en Linea”, “Controlador listo para encender o apagar luces de la casa.”);
Blynk.notify(“Control de Luces Encendido”);

}

void loop()
{
Blynk.run();
}

How your hardware can send email without internet or Power? I think It only done on server side or something doesn’t need internet to notify you when no-internet. With Blynk app, there is widget call Push notification. Your phone will get notification when your hardware disconnect to server. I think your email code is useless, because, when blynk connect false, how blynk do email action? email is server’s action, when your hardward send command to server than server send email. If your hardware is not connecting to server, how server get command?

Code snippets should be formatted. Edit your post

Wrap the code by adding 3 Backtick: ``` symbols:

Example:

 ``` cpp <--put 3 backticks BEFORE your code starts  (cpp means C++ language) 

   //Put your code here
   //..................
   //..................

 ``` <--insert 3 backticks AFTER your code

**This makes your code readable and with highlighted syntax, like this:**
//comment goes here 
void helloWorld() { 
   String message =  "hello" + "world"; 
}

NHN, Thank you for your comments.
Just to clarify; im not asking to send an email from the hardware that is currently off or has not internet connection.
Please check my question again:
" I’m able to configure my blynk app and the sketch to send email when the hardware come online " --> I’m receiving the email when the MCU is online again.

" an app notification when the MCU goes offline and online" --> I receive this notification in my smartphone.

" but i dont know how to do the same but sending an email when the hardware goes offline (Power failure or internet disconnection)" --> i mean how an email can be sent using another way warning that the MCU is offline. It is clear this can not be done by the MCU.

As you can see the code is working, i receive the email when the MCU is online again, but i need to send an email when the MCU is offline.

Thanks for your help…

Sending email when hardware is Off-Line, should be a task performed by the Server (which pings hardware periodically to verify integrity of communication between them).
It should be similar to send a Notification.
For example in the Notification Settings menu there is the option
“NOTIFY WHEN HARDWARE GOES OFFLINE”
a new option should be added like
“SEND EMAIL WHEN HARDWARE GOES OFFLINE”
which could make use of the Email widget (it should be added of course into the Application Template) and its default mail recipient.
As far as i know there is no such a facility yet, so, we better add it to the ideas-wishlist chapter

@kostas Are you asking a new question? Or commenting on a two year old topic :stuck_out_tongue: (which it looks like you are :stuck_out_tongue_winking_eye: )

If the former, please create a new topic with your details.

If the latter… please take note of the Time & Date stamps before chipping in… a few months later is bad enough as the OP may have since resolved the issue, or changes over time make the issue irrelevant.

But answering, or even just commenting, years later… well, then the issue is old enough to not be worth dragging to this forum’s forefront… :slight_smile: