Logic Machine Forum
\n - newline inside a mail message - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: \n - newline inside a mail message (/showthread.php?tid=5882)



\n - newline inside a mail message - Chandrias - 10.02.2025

I have created the following script, which works perfect, besides the new line command.
Any idea on how to get through that?


-- Get required variables
fVoltage = grp.getvalue('7/0/3')
iVoltage = math.floor(fVoltage)


-- Define email subject
subject = 'Dimos House - W/H 1 Voltage Failure'


-- Define email message
table[1] = "W/H 1 Voltage below expected value."
table[2] = "\n(Voltage : "
table[3] = tostring(iVoltage)
table[4] = "V)"
message = table.concat(table, '', i, j)


-- Send email
mail('xxxx@gmail.com', subject, message)


RE: \n - newline inside a mail message - admin - 11.02.2025

mail() function uses HTML content type. Use <br> instead of \n.


RE: \n - newline inside a mail message - Chandrias - 13.02.2025

(11.02.2025, 07:05)admin Wrote: mail() function uses HTML content type. Use <br> instead of \n.

Already found that solution. Thank you for your help.