Help with

hello i need help on getting this to work is it a String, Char, etc:

void Send_Email(){
  char t1[EMAIL.length() +1];
  char t2[NAME.length() +1];
  String t3 = "Your water alarm " + NAME + " has detected water";
  char t4[t3.length()+1];

  EMAIL.toCharArray(t1, EMAIL.length());
  NAME.toCharArray(t2, NAME.length());
  t3.toCharArray(t4, t3.length());, t2, t4);


I think it should be

String t3 = String("Your water alarm ") + NAME + " has detected water";

But this code still looks complicated. I recommend you to google something like “Arduino concat string”

@Dmitriy, thanks but im still getting this error

exit status 1
no matching function for call to 'BlynkWifi::email(char [(((sizetype)<anonymous>) + 1)], char [(((sizetype)<anonymous>) + 1)], char [(((sizetype)<anonymous>) + 1)])'

does it work if you instead do:, t2, String(t4));

maybe the function requires all string parameters…

No it still errors out

@FunguyPro to debug this do the following:

Before char t1[EMAIL.length() +1]; enter:

  String EMAIL = "";
  String NAME = "Costas";, t2, t4) enter:


You will see:>Costa>Your water alarm Costas has detected wate

t1, t2 and t4 are all 1 character short.

This code compiles and email is received:

  char emailaddress[20] = "";
  char emailsubject[20] = "Email from Blynk";
  String myname = "Costas";
  String one = "hi there ";
  String two = " are you ok?";
  String three = one + myname + two;
  Serial.print("Sending email to ");
  Serial.print(" with subject of ");
  Serial.print(" and message of ");
  Serial.println(three);, emailsubject, three); 

Serial Monitor:

Sending email to with subject of Email from Blynk and message of hi there Costas are you ok?

1 Like

OK thank you, that worked :smile: @Costas