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.

Email Multi destination address
#4
I'm using script like this and it works even if one of the emails are empty.
Code:
alarm = grp.getvalue('10/0/31')

email1 = grp.getvalue('32/6/1')
email2 = grp.getvalue('32/6/2')
email3 = grp.getvalue('32/6/3')

if email1~='' then
  if email2~='' then
    if email3~='' then
      emails = {email1,email2,email3}
    else
      emails = {email1,email2}
    end
  else
    emails = {email1}
  end
else
  if email2~='' then
    if email3~='' then
      emails = {email2,email3}
    else
      emails = {email2}
    end
  else
    if email3~='' then
      emails = {email3}
    end
  end
end
 
if alarm then
  mail(emails, 'MAJA valvekeskuse alarm', 'Tere! <br><br>Valvekeskuse poolt on tuvastatud MAJA häire! Palun vaadake täpsemalt visualiseeringust.<br><br><br><i>See email on genereeritud automaatikasüsteemi poolt. Palun mitte sellele emailile vastata!')
end
Reply


Messages In This Thread
Email Multi destination address - by Frank68 - 23.07.2020, 14:36
RE: Email Multi destination address - by fleeceable - 28.07.2020, 10:57

Forum Jump: