EmailSender error message

Viewing 2 reply threads
  • Author
    Posts
    • #12387
      Alejandro Reboredo

        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

         

         

         

      • #12388
        Alejandro Reboredo

          Sorry , I’ve just saw another question in this forum which says it’s necessary to add Gmail and port to the WiFiNiNa update firmware process in order to allow the module to communicate.
          I’ll will check that and also with my server to see if this is the reason.
          I’ll be back here with the results

          • #12406
            Alejandro Reboredo

              back again.

              last version of WIFININA firmware updated an I have also updated the firmware with the google.com:443 server certificates and I’m getting same answer from EmailSender

              status: 0
              code: 2
              description: Could not connect to mail server

              so I’m not sure if it is compatible with the use of IOT cloud

              any help really appreciated

              Alex

          • #12407
            Renzo Mischianti
            Keymaster

              Hi Alex,
              the port you use is 587, I think It’s STARTTSL protocol, and It’s not supported by my library.
              You must choice a service that use SSL only.
              Bye Renzo

          Viewing 2 reply threads
          • You must be logged in to reply to this topic.
          Exit mobile version