Not receiving an email from Blynk code

I’m not receiving an email from Bynk code. I have earlier successfully got emails from dispatcher@blynk.io . Today when I tried running one of my old codes, that didn’t help too. I suspect that the backend service is down.

Is anyone else facing a similar issue.

Regards

I received a token from dispatcher about 60 minutes ago.

Will ask for it to be sent again.

Edit: new token received.

Works fine. Please check spam folder.

I receive tokens as well, but the Blynk.email() is not sending any emails. I have one right in my setup that tells me my hardware is live.

Checked spam folder as well.

Maybe you reached limit in 100 daily emails?

No I didn’t reach the limit. Please review my Code Snippet.

#define BLYNK_PRINT Serial    // Comment this out to disable prints and save space
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <SimpleTimer.h>
#include <NewPing.h>


#define TRIGGER_PIN  D6  // Arduino pin tied to trigger pin on the ultrasonic sensor.
#define ECHO_PIN     D7  // Arduino pin tied to echo pin on the ultrasonic sensor.
#define MAX_DISTANCE 332 
#define PING_INTERVAL 200 // Milliseconds between pings.

NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE);

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).

//Receiver
//char auth[] = "********";
//Water Tank 2
char auth[] = "********";
//Water Tank 3
//char auth[] = "********";

//Water Tank 1
//char auth[] = "********";

//WidgetLCD lcd(V0);

SimpleTimer timer;


WidgetBridge bridge1(V1);

BLYNK_CONNECTED() {
  // Place the AuthToken of the second hardware here
  bridge1.setAuthToken("********"); 
}

void setup()
{  
  Serial.begin(9600);
  delay(10);
  
  Blynk.begin(auth, "SSID", "pwd");
  delay(10);
  Blynk.email("pavitar@"********".com","Water Tank #Pilot Online","Water Tank is online.");
  timer.setInterval(1000L, ultra);
}

void ultra()
{
    unsigned int uS = sonar.ping();
    int level = (uS / US_ROUNDTRIP_CM);    
    int totalheight = 312 - 20;    
    int netlevel = level - 20;
    
    long tankemptylevel = (((float)netlevel / (float)totalheight) * 100);

    long tank_fulllevel_Percentage = 100 - tankemptylevel;
    
      //    Debug    
      //    Blynk.virtualWrite(V1,level);
      //    Blynk.virtualWrite(V2,totalheight);
      //    Blynk.virtualWrite(V3,netlevel);
      //    Blynk.virtualWrite(V4,tankemptylevel);    
      //    Blynk.virtualWrite(V5,tank_fulllevel_Percentage);

      Blynk.virtualWrite(V1,tank_fulllevel_Percentage);
      Blynk.virtualWrite(V2, 312 - netlevel);
      //Blynk.virtualWrite(V3, pTotalheight);

     int brightness = 20;
    if(tank_fulllevel_Percentage <= 15){ //0 - 15% 
        bridge1.analogWrite( 2, brightness); //RED 
        bridge1.analogWrite(13, 0); //RED
        bridge1.analogWrite( 0, 0); //BLUE    
        bridge1.analogWrite(12, 0); //BLUE
        bridge1.analogWrite( 4, 0); //GREEN
        bridge1.analogWrite(14, 0); //GREEN
        Blynk.email("pavitar@"********".com","Water Tank #Pilot Status Alert","Water Tank is almost empty - At "+(String)tank_fulllevel_Percentage+"%.Please fill it asap.");
        Blynk.email("vishwas@"********".com","Water Tank #Pilot Status Alert","Water Tank is almost empty - At "+(String)tank_fulllevel_Percentage+"%.Please fill it asap. ");
    }else if(tank_fulllevel_Percentage <= 30){ //16 - 30% 
        bridge1.analogWrite( 2, brightness); //RED 
        bridge1.analogWrite(13, brightness); //RED
        bridge1.analogWrite( 0, 0); //BLUE    
        bridge1.analogWrite(12, 0); //BLUE
        bridge1.analogWrite( 4, 0); //GREEN
        bridge1.analogWrite(14, 0); //GREEN
    }else if(tank_fulllevel_Percentage <= 50){ //31 - 50%
        bridge1.analogWrite( 2, brightness); //RED 
        bridge1.analogWrite(13, brightness); //RED
        bridge1.analogWrite( 0, 30); //BLUE    
        bridge1.analogWrite(12, 0); //BLUE
        bridge1.analogWrite( 4, 0); //GREEN
        bridge1.analogWrite(14, 0); //GREEN
    }else if(tank_fulllevel_Percentage <= 70){ //51 - 70%
        bridge1.analogWrite( 2, brightness); //RED 
        bridge1.analogWrite(13, brightness); //RED
        bridge1.analogWrite( 0, 30); //BLUE    
        bridge1.analogWrite(12, 30); //BLUE
        bridge1.analogWrite( 4, 0); //GREEN
        bridge1.analogWrite(14, 0); //GREEN
    }else if(tank_fulllevel_Percentage <= 90){ //71 - 90%
        bridge1.analogWrite( 2, brightness); //RED 
        bridge1.analogWrite(13, brightness); //RED
        bridge1.analogWrite( 0, 30); //BLUE    
        bridge1.analogWrite(12, 30); //BLUE
        bridge1.analogWrite( 4, 100); //GREEN
        bridge1.analogWrite(14, 0); //GREEN
        
    }else if(tank_fulllevel_Percentage > 91){ //91 - 100% 
        bridge1.analogWrite( 2, brightness); //RED 
        bridge1.analogWrite(13, brightness); //RED               
        bridge1.analogWrite( 0, 30); //BLUE    
        bridge1.analogWrite(12, 30); //BLUE
        bridge1.analogWrite( 4, 100); //GREEN
        bridge1.analogWrite(14, 100); //GREEN
        Blynk.email("pavitar@"********".com","Water Tank #Pilot Status Alert","Water Tank is almost full - At "+(String)tank_fulllevel_Percentage+"%.Please stop filling to avoid overflow.");
        Blynk.email("vishwas@"********".com","Water Tank #Pilot Status Alert","Water Tank is almost full - At "+(String)tank_fulllevel_Percentage+"%.Please stop filling to avoid overflow. ");        
    }
    
    
    //Blynk.setProperty(V1,"label", "Percentage");    
    //Blynk.setProperty(V1,"color", "#D3435C");
}

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

Well you HAVE exceeded Blynks limit of 1 email per 15 seconds :wink: Fix your code, don’t assume Blynk error without checking first.

Your sketch shows the possibility of sending at least two emails, one after another (error #1) in a loop that runs every second and no flag check to see if email has been already sent in last 15 seconds (error #2). And this doesn’t count the initial email at the start of the sketch.

Hey as I said before, this code was running absolutely fine until I checked recently.

However, even after I commented the function ultra() to avoid frequent emails it still doesn’t work. That way only the first Blynk.email() inside setup() should run right?

Here is how my setup() looks now:

void setup()
{  
  Serial.begin(9600);
  delay(10);
  
  Blynk.begin(auth, "SSID", "pwd");
  delay(18000); //increased delay to 18 secs

  Blynk.email("pavitar@"********".com","Water Tank #Pilot Online","Water Tank is online.");

  //timer.setInterval(1000L, ultra); // commented to avoid frequent emailing
}

Email system is working fine.

Start with a very simple sketch to test and work your way up from there.

I already did that. Check my previous reply. I commented all the complex code and just have the three basic functions Serial.Begin() , Blynk.begin() and then Blynk.email() in my setup()

Local or Cloud server?

Cloud.

@Gunner What Could be the issue here?

I dunno?.. Try removing the email widget from your project and adding it back again.

Still doesn’t work!