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.

problem with index mail address
#1
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
Reply
#2
what error do you get?
------------------------------
Ctrl+F5
Reply
#3
(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'
Reply
#4
Check script line 177. The object referenced by grp.getvalue is probably missing.
Reply


Forum Jump: