Send mail inside of a function

Home Forums esp8266 Send mail inside of a function

Viewing 3 reply threads
  • Author
    Posts
    • #24076
      ozzy
      Participant

        Hi Renzo,

        I get a string from my SQL database which is moved inside of the payload

        String payload = https.getString();
        SendEmail(payload);

        The string goes to the SendEmail function as below

        void SendEmail (String testo_mail) {
        EMailSender::EMailMessage message;

        message.subject = “SMART POT”;
        message.message = testo_mail;
        Serial.println(“testo ricevuto: “+ testo_mail);

        EMailSender::Response resp = emailSend.send(indirizzo, message);

        Serial.println(“Sending status: “);
        Serial.println(resp.status);
        Serial.println(resp.code);
        Serial.println(resp.desc);
        }

        but I got a server error.

        Do you have a clue of what it might be wrong?

        Many thanks !!!!

        Andrea

      • #24077
        Renzo Mischianti
        Keymaster

          Hi ozzy,
          If you receive a server error, there are probably some issues with the server configuration.
          Bye Renzo

        • #24078
          ozzy
          Participant

            Hi Renzo,

            many thanks for the follow up.

            I think I fix the issue where I needed to close the connection to the sql server before to sending the email.

            I made an amazing project, thanks to your code.

            Again, many thanks for your passion and your contribution.

            Andrea

          • #24079
            Renzo Mischianti
            Keymaster

              Hi Andrea,
              if you like to share your project contact me, if It’s adequate I give you a space on the site.
              Bye Renzo

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