Send email with line breaks

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
User avatar
cbartetzko
Posts: 27
Joined: Sunday 25 December 2016 9:24
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Location: Speyer/Germany
Contact:

Send email with line breaks

Post by cbartetzko »

Hi,

Im trying to send emails within a dzVents script, where the email body consists of a concatenated string including line breaks (\n)

Obviously the line break escape codes (\n) are ignored and the whole message is submitted in the email as unformatted string in the body,
which looks like a mess.

I've tried the same thing in a normal Lua-Script and in a Blockly-Script.
Lua creates the same mess in the email, Blockly is doing the job as expected.

Any idea, what I can do to make escape codes not being ignored in dzVents/Lua ?
User avatar
emme
Posts: 909
Joined: Monday 27 June 2016 11:02
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Milano, Italy
Contact:

Re: Send email with line breaks

Post by emme »

try with html tag <br>
The most dangerous phrase in any language is:
"We always done this way"
User avatar
cbartetzko
Posts: 27
Joined: Sunday 25 December 2016 9:24
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Location: Speyer/Germany
Contact:

Re: Send email with line breaks

Post by cbartetzko »

Yeah, that did the trick.
Thank you so much.
That's even better. Now I can build a table in the email with html tags.
Post Reply

Who is online

Users browsing this forum: Amazon [Bot] and 1 guest