- This topic has 4 replies, 1 voice, and was last updated 4 years, 2 months ago by .
- You must be logged in to reply to this topic.
Home › Forums › The libraries hosted on the site › EMailSender send email with attachments › EMailSender new Line Character in the message
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!
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
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.
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
I will give it a try. And update you.
More
3D Printer 3D printer upgrade ABB Arduino Arduino IDE Arduino SAMD boards Aurora AWS CNC Cyclone PCB Factory Cyclone PCB Factory how to build It Display DynamoDB E32 E70 EByte esp01 esp32 esp8266 File System Firmware i2c Library LoRa MicroPython Milling PCB My PCB Networking PCB pinout Power saving Raspberry Pi REST API RF rp2040 SD Card Sensors Sleep and Wake UP SPI STM32 Temperature Tutorial Web Server Wemos D1 mini WiFi