Send email with line breaks

Easy to use, 100% Lua-based event scripting framework.
Post Reply
User avatar
cbartetzko
Posts: 24
Joined: Sunday 25 December 2016 10:24
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Speyer/Germany
Contact:

Send email with line breaks

Post by cbartetzko » Wednesday 14 February 2018 12:28

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: 849
Joined: Monday 27 June 2016 11:02
Target OS: Raspberry Pi
Domoticz version: latest
Location: Milano, Italy
Contact:

Re: Send email with line breaks

Post by emme » Wednesday 14 February 2018 12:41

try with html tag <br>
The most dangerous phrase in any language is:
"We always done this way"

User avatar
cbartetzko
Posts: 24
Joined: Sunday 25 December 2016 10:24
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Speyer/Germany
Contact:

Re: Send email with line breaks

Post by cbartetzko » Wednesday 14 February 2018 17:33

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: No registered users and 5 guests