16.11.2019, 11:05
Good morning:
I can't send the emails from Logic Machine
In Scriptin, common funtions I have configured this way:
-- send an e-mail
function mail(to, subject, message)
-- make sure these settings are correct
local settings = {
-- "from" field, only e-mail must be specified here
from = 'logicmahine@gmail.com',
-- smtp username
user = 'logicmahine@gmail.com',
-- smtp password
password = 'logicmachine1234',
-- smtp server
server = 'smtp.gmail.com',
-- smtp server port
port = 465,
-- enable ssl, required for gmail smtp
secure = 'sslv23',
}
local smtp = require('socket.smtp')
if type(to) ~= 'table' then
to = { to }
end
for index, email in ipairs(to) do
to[ index ] = '<' .. tostring(email) .. '>'
end
Then I created an event through a virtual object called Test
value = event.getvalue()
if value == true then
mail('myemail@gmail.com','Alarma Prueba','Alarma Prueba')
else
mail('myemail@gmail.com','No Alarma Prueba','Alarma Prueba Desactiva')
end
But when the value of the event is "1" I don't receive any email
I have verified that the mail I created for LM is operational
Can you help me someone please?
BR
Josema
I can't send the emails from Logic Machine
In Scriptin, common funtions I have configured this way:
-- send an e-mail
function mail(to, subject, message)
-- make sure these settings are correct
local settings = {
-- "from" field, only e-mail must be specified here
from = 'logicmahine@gmail.com',
-- smtp username
user = 'logicmahine@gmail.com',
-- smtp password
password = 'logicmachine1234',
-- smtp server
server = 'smtp.gmail.com',
-- smtp server port
port = 465,
-- enable ssl, required for gmail smtp
secure = 'sslv23',
}
local smtp = require('socket.smtp')
if type(to) ~= 'table' then
to = { to }
end
for index, email in ipairs(to) do
to[ index ] = '<' .. tostring(email) .. '>'
end
Then I created an event through a virtual object called Test
value = event.getvalue()
if value == true then
mail('myemail@gmail.com','Alarma Prueba','Alarma Prueba')
else
mail('myemail@gmail.com','No Alarma Prueba','Alarma Prueba Desactiva')
end
But when the value of the event is "1" I don't receive any email
I have verified that the mail I created for LM is operational
Can you help me someone please?
BR
Josema