This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

scripitng
#1
hello i made this script i receive to error logs this ( User script:13: attempt to call field 'listen' (a nil value) stack tracebackSmilean anyone help me 

local smtp_server = 'logicmachine email'
local smtp_port = 587
local smtp_user = 'admin'
local smtp_pass = 'admin'
local recipient = 'mariospoulorinis@gmail.com'
local subject = 'Ειδοποίηση: Ενεργοποίηση αισθητήρα βροχής'
local message = 'Ομπρέλα να πάρεις'




event.listen(rain_sensor_ga, function(event)
  if value == true then 
    log
  ' email(smtp_server, smtp_port, smtp_user, smtp_pass, recipient, subject, message)'
   
  end
end)
Reply
#2
Please stop using chatGPT and search for examples on the forum.
------------------------------
Ctrl+F5
Reply
#3
i tried this from the forum and it didnt work
value = event.getvalue()

to = 'test@test.com'
subject = 'Alert'
message = 'KNX object 1/2/2 value is: ' .. tostring(value)

res, err = mail(to, subject, message)

if not res then
  log(err)
end
Reply
#4
Did you setup, common functions with your email server settings?
------------------------------
Ctrl+F5
Reply
#5
yes and i get this * string: 535-5.7.8 Username and Password not accepted. For more information, go to
535 5.7.8 https://support.google.com/mail/?p=BadCredentials 5b1f17b1804b1-433b01e1030sm85985385e9.7 - gsmtp
but i cheked the username and the password
Reply
#6
See this
https://forum.logicmachine.net/showthrea...1#pid26361
------------------------------
Ctrl+F5
Reply
#7
now i get this
* string: host not found
Reply
#8
Check smpt server, seems it is wrong.
------------------------------
Ctrl+F5
Reply


Forum Jump: