Sendmail with formatted text and list of items in rows

Hi, i´m on latest OH 2.2 snapshot.

I want to get an email with a list of item-states.

Maybe like this:

Item 1 = 123
Item 2 = 456
Item xyz = closed

How can i do this? How can i start a new line inside the sendmail command?

sendMail("", "Openhab - E-Mail", "Text blablabla." +item.state)

Have you tryed “\n” ?

Depending on your email client, you can format the body of the email using HTML. I’ve used that to create tables of financial data from Google Sheets as emails.

You can try inserting <br> for the new lines if the \n doesn’t work and see if that works. Otherwise, you might need to create the body as a full HTML document.