hello
i am trying to send data in a mail using arduino uno wifi rev2, i tried this program but it doesn't work.
the arduino is already connected to the wifi.
could you check the following program and tell me what i have to change or any suggestions ?
thanks.
#include <WiFiNINA.h>
#include <SPI.h>
char from [] = "arduinounowifirev2@yahoo.com"; // email of sender
char password [] = "xxxxxxxxx"; // email password
char to [] = "xxxxxxxxxxx";
char sub [] = "Results";
String from_base64 = ("YXJkdWlub3Vub3dpZmlyZXYyQHlhaG9vLmNvbQ=="); // email of sender in base64
String password_base64 = ("xxxxxxxxxx"); // email password in base64
const String host [] = "pop.mail.yahoo.com";
const String port [] = "995";
wifi.connect ( host , port );
if (wifi.connect(host, port)) {
Serial.println ( " access to server " );
wifi.println("EHLO kltan");
wifi.println(F("250"));
wifi.println("AUTH LOGIN");
wifi.println(F("334 YXJkdWlub3Vub3dpZmlyZXYyQGhvdG1haWwuY29t"));
wifi.println (from_base64);
wifi.println(F("334 bWhhbWFkMTIz"));
wifi.println ( password_base64 );
wifi.println ( F ("235"));
char mailfrom [20] = "MAIL FROM:<";
strcat ( mailfrom , from );
strcat ( mailfrom , ">" );
wifi.println ( mailfrom );
wifi.println (F ("250"));
char mailto [20] = "RCPT TO:<";
strcat ( mailto , to );
strcat ( mailto , ">" );
wifi.println ( mailto );
wifi.println ( F ("250"));
wifi.println ( "DATA" );
wifi.println ( F ("354"));
char efrom [50] = "FROM: ";
strcat ( efrom , from );
strcat ( efrom , " " );
strcat ( efrom , "<" );
strcat ( efrom , from );
strcat ( efrom , ">" );
wifi.println ( efrom );
char eto [50] = "TO: ";
strcat ( eto , to );
strcat ( eto , " " );
strcat ( eto , "<" );
strcat ( eto , to );
strcat ( eto , ">" );
wifi.println ( eto );
char subject [50] = "SUBJECT: ";
strcat ( subject , sub );
wifi.println ( subject );
wifi.println ( "\r\n" );
wifi.println ("welcome to Arduino, we will count the results and send them each 5 min. ");
wifi.println ( "\r\n" );
wifi.println ( "QUIT" );
}else{
Serial.println ( " couldn't access to server " );
}