Line break in email text

How can I use multiple lines in a mail text?
Unfortunately it does not work like this:

String textmessage1 = "Fotozellenwert: " + String(reading) + String("\n");
  String textmessage2 = "WLAN:           " + String(WiFi.SSID());
  if ((reading > fotozellenwert1) && (zeit1 > interval)) 
  //if (reading > fotozellenwert1) 
  {
      EMailSender::EMailMessage message;
      message.subject = betrefftext2;
      message.message = textmessage1 + textmessage2;
      EMailSender::Response resp = emailSend.send(mailempfaenger, message);
      previousMillis = millis();   
  }

This is the current result without line break:
Fotozellenwert: 2634 WLAN: Matrix

My goal is that it looks like this:
Fotozellenwert: 2634
WLAN: Matrix

Thanks for help!

It does not work like that either:

String textmessage1 = "Fotozellenwert: " + String(reading) + "\n";

Have you tried

String textmessage1 = "Fotozellenwert: " + String(reading) + "<b>";

It's just a guess. It is very difficult to help when only a snippet of code is posted. We cannot see what libraries are being used, for example.

You should post the full code, or a cut-down version of the code that shows the problem.

Thats it!

"<b> "         stands for bold
"<br />"      thats what I needed

Thank you!`

`

Oh, yes, bold...sorry. But the important thing is it appears to understand html tags.

You could also try making each line a paragraph:

  String textmessage1 = "<p>Fotozellenwert: " + String(reading);
  String textmessage2 = "<p>WLAN:           " + String(WiFi.SSID());

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.