![]() |
|
email notification - Printable Version +- LogicMachine 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: email notification (/showthread.php?tid=226) |
email notification - Peter - 22.02.2016 Hello guys, I have some problems with email notification. Using the script example from here LINK does not generally work. I can send emails to my companys' other email address but that is just thanks to less strict policies when sending from one our email address to another. I can see there is missing "from" field in my received message, eventhough I am quite sure I did the configuration of the script right. Anybode else having this same issue? Thank you Peter RE: email notification - admin - 23.02.2016 log() the result of mail() function, it should tell why it cannot be sent RE: email notification - PassivPluss - 18.10.2016 Hi Yesterday i programmed the email notification from www.openrb.com examples. I tried to update to latest version on my LM now and the mail sending doesnt work anymore. How do I fix it? I am using the code underneath and have made the gmail account allow unsure apps. event based mail('exampe@gmail.com', 'Alert', 'KNX object 1/2/2 value is') common functions
RE: email notification - PassivPluss - 26.10.2016 Dies anybody else have running/working email script on last rc of firmware? RE: email notification - admin - 27.10.2016 Please try installing this package through System config -> Packages and try again: https://dl.openrb.com/lm-16.09-rc2/libwolfssl_3.9.10-1_mxs.ipk RE: email notification - AEK - 27.10.2016 (27.10.2016, 07:16)admin Wrote: Please try installing this package through System config -> Packages and try again: it works! just tested RE: email notification - buuuudzik - 27.10.2016 I installed this package and I am using this script: Code: -- 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 = 'my@gmail.com',
-- smtp username
user = 'my@gmail.com',
-- smtp password
password = 'my_password',
-- 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
-- message headers and body
settings.source = smtp.message({
headers = {
to = table.concat(to, ', '),
subject = subject,
['Content-type'] = 'text/html; charset=utf-8',
},
body = message
})
-- fixup from field
settings.from = '<' .. tostring(settings.from) .. '>'
settings.rcpt = to
return smtp.send(settings)
endand when I am trying to use this script I have the answer: Code: * arg: 1
* nil
* arg: 2
* string: revcd alert fatal errorRE: email notification - admin - 27.10.2016 Which firmware are you running? This will only work with RC2. RE: email notification - buuuudzik - 27.10.2016 (27.10.2016, 18:02)admin Wrote: Which firmware are you running? This will only work with RC2. Version: 20160927 RE: email notification - admin - 27.10.2016 Load balancer? RE: email notification - buuuudzik - 27.10.2016 (27.10.2016, 18:15)admin Wrote: Load balancer? Yes, this is LM Load Balancer but I will check also on the LM4 ![]() This is from LM4: Code: * arg: 1
* nil
* arg: 2
* string: 534-5.7.14 <https://accounts.google.com/signin/continue?sarp=1&scc=1&plt=AKgnsbv3
534-5.7.14 B4a0GJrvUSCidM5P03E1SsXID36ZOcEUAcaehwrepStPcHe0aoR1xRL-V1F_qWhgaiQFgJ
534-5.7.14 FzcpqA2Y8mV80gWO4TzLzCBPuDwMj0tvsuwVMxCxIpBp-Zf1cGXoZEKjstdduN61_SOB3M
534-5.7.14 wMhNNh1JuVg7MMR2WvevrCJk_M9PaP6EFCT_y9VJvQZpaV_7d7H2bh_OcSUXB1wBxuBZJr
534-5.7.14 629FJG8MK3aeOXfYu5gk7MRwtwRhM> Please log in via your web browser and
534-5.7.14 then try again.
534-5.7.14 Learn more at
534 5.7.14 https://support.google.com/mail/answer/78754 h68sm1557090lji.20 - gsmtp But if this is about Load Balancer it not works and the problem is the same stiill
RE: email notification - admin - 28.10.2016 You to install this package for Load Balancer: https://dl.openrb.com/lm-16.09-rc2/libwolfssl_3.9.10-1_x86.ipk RE: email notification - buuuudzik - 28.10.2016 (28.10.2016, 06:42)admin Wrote: You to install this package for Load Balancer: It works. Nice
RE: email notification - PassivPluss - 30.10.2016 The package works. Note to admin: U should edit post were the firmware update is to also include this package. And other bugfixes like this. That way other users dont have to waste a couple of hours looking for a fault in their own scripting... |