EMailSender new Line Character in the message

Home Forums The libraries hosted on the site EMailSender send email with attachments EMailSender new Line Character in the message

Tagged: , ,

Viewing 4 reply threads
  • Author
    Posts
    • #6204
      kamranrasul

        Hi Guys,

        Indeed the EMailSender works perfectly. I was trying to send a message as 5-8 lines/ paragraph but the message received in Gmail doesn’t contain any new lines but only spaces.

        Am I using them correctly? Please help!

      • #6206
        Renzo Mischianti
        Keymaster

          Hi kamranrasul,
          with kind of character you use? \r \n??
          You can also use HTML notation and you can obtain the same result with that.
          Bye Renzo

        • #6207
          kamranrasul

            Thanks for the response Renzo!

            I’m using both \n and \r.

            I’m very new to esp32 and especially the email setup. Can you please shed some more detail on you suggestion?

            I’ve tried ESP32_MailClient.h and it works fine with Arduino but when I try it with Visual Studio Code, PlatformIO, there are too many compilation errors in the library.

          • #6209
            Renzo Mischianti
            Keymaster

              I think that I undestand the problem.
              In my library I try to give all the possibility, and as default the body of email si in HTML format, for example you can write a text like so

                  EMailSender::EMailMessage message;
                  message.subject = "Soggetto";
                  message.message = "<img src='http://mischianti.org/wp-content/uploads/2020/01/logo256.jpg'/><br><br>Ciao come stai<br>io bene.<br>Login set ok;<br>This is my link <a href='mischianti.org'>Mischianti's Blog</a>";
              
              the result is an email like this

              but if you want sent a simple email in TEXT format you must specify the correct mime type, so you must write an email like so

                  EMailSender::EMailMessage message;
                  message.subject = "Soggetto";
                  message.message = "Ciao come stai\nio bene.\nLogin set ok;";
                  message.mime = MIME_TEXT_PLAIN;
              

               

              And in TEXT format line feed and carraige return work fine.

              Give me a feedback, but I think the problem is this, you can try to use text line feed with HTML format.

              Bye Renzo

            • #6210
              kamranrasul

                I will give it a try. And update you.

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