Hi, I'm working with an Arduino Nano 33 IOT connected to the Arduino cloud.
I'm trying to send e-mail alerts when a particular condition is reached by different sensors and values.
I'm testing with a simple working code to test the EmaiSender library.
the Wi-Fi connection is stablished by the cloud communication setup routines in the sketch
so the Wi-Fi connection is stablished before I call the specific section of EMailSender::EMailMessage message; function
when this function to send mail is called I receive this error as three answers from the smtp server:
status: 0
code: 2
description: Could not connect to mail server
I've tested a mailbox smtp configuration I will use specifically for this project and of course I've also used Gmail standard configuration as in the example to verify this error.
I'm sure there is something very silly I'm missing or maybe the config/encrypting side of WiFi needed by Arduino Cloud is not compatible with EmailSender use of Wi-Fi
in the declaration section of code I have tested this
first config tested:EMailSender emailSend("user@mysmptmail.com","mypassword","user@mysmptmail.com","myname","smtp.server.com",587);second config tested:EMailSender emailSend("mygmailaccount@gmail.com","mygmailpassword");
and my sendmail function is:
void sendem() {EMailSender::EMailMessage message;message.subject = "Alert";message.message = "Sample alert message";EMailSender::Response resp = emailSend.send("someone@domain.com",message);Serial.println("Sending status: ");Serial.println(resp.status);Serial.println(resp.code);Serial.println(resp.desc);}
I'm not really skilled on programming, so I'm pretty sure there is something as simple as silly that an old newbie like me can't even figure out!
thanks for any help or advice on this
Alex
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.