LogicMachine Forum
problem with index mail address - 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: problem with index mail address (/showthread.php?tid=6196)



problem with index mail address - Frank68 - 20.11.2025

I have this erro rwhen try send mail

whit this script

mail_send=grp.getvalue('32/4/'..idx)
  if (mail_send == true) then
    -- verificare indirizzi a cui mandare mail
    emails = {}
      -- verifico indirizzi per MAIL
    if (grp.getvalue('32/1/201') == true) then
      table.insert(emails, grp.getvalue('32/1/10'))
    end
        if (grp.getvalue('32/1/202') == true) then
      table.insert(emails, grp.getvalue('32/1/11'))
    end
        if (grp.getvalue('32/1/203') == true) then
      table.insert(emails, grp.getvalue('32/1/12'))
    end
        if (grp.getvalue('32/1/204') == true) then
        table.insert(emails, grp.getvalue('32/1/13'))
    end
        if (grp.getvalue('32/1/205') == true) then
      table.insert(emails, grp.getvalue('32/1/14'))
        end
    if (grp.getvalue('32/1/206') == true) then
      table.insert(emails, grp.getvalue('32/1/15'))
end
        if (grp.getvalue('32/1/207') == true) then
      table.insert(emails, grp.getvalue('32/1/16'))
end
    if (grp.getvalue('32/1/208') == true) then
      table.insert(emails, grp.getvalue('32/1/17'))
      end
        if (grp.getvalue('32/1/210') == true) then
      table.insert(emails, grp.getvalue('32/1/140'))
    end
        if (grp.getvalue('32/1/211') == true) then
        table.insert(emails, grp.getvalue('32/1/141'))
    end
        if (grp.getvalue('32/1/212') == true) then
      table.insert(emails, grp.getvalue('32/1/142'))
        end
    if (grp.getvalue('32/1/213') == true) then
      table.insert(emails, grp.getvalue('32/1/143'))
end
        if (grp.getvalue('32/1/214') == true) then
      table.insert(emails, grp.getvalue('32/1/144'))
end
    if (grp.getvalue('32/1/215') == true) then
      table.insert(emails, grp.getvalue('32/1/145'))
      end
    if #emails > 0 then
      mail(emails, subject, message)
      --log(tostring(emails))
  else
    log('no valid mail adresses found')
end    
    end


RE: problem qith indecx mail address - Daniel - 21.11.2025

what error do you get?


RE: problem qith indecx mail address - Frank68 - 24.11.2025

(21.11.2025, 08:34)Daniel Wrote: what error do you get?

this error


User script:177: bad argument #2 to 'insert' (number expected, got nil)
stack traceback:
[C]: in function 'insert'


RE: problem qith indecx mail address - admin - 24.11.2025

Check script line 177. The object referenced by grp.getvalue is probably missing.