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 : Email with Wiser for KNX
#18
(20.06.2022, 12:21)Hello everyone. I have a specific demand to have a "From" different for the email. I would like to have a from : Maintenance Company BMS and not an email adress. I have tried but I didnt find solution. Wrote:   -- make sure these settings are correct
 
  ---------------BEGINNING OF USER EDITABLE AREA-------------------
  local settings = {
    -- "from" field, only e-mail must be specified here
    
  from = 'Maintenance Company BMS',
    -- smtp username
    
    user = 'jero*****@gmail.com',
    -- smtp password
    password = 'wrzss****,
    -- smtp server
    server = 'smtp.gmail.com',
    -- smtp server port
    port = 465,
    -- enable ssl, required for gmail smtp
    secure = 'sslv23',
  }
  -------------------END OF USER EDITABLE AREA---------------------

  local smtp = require('socket.smtp')
  local escape = function(v)
    return '<' .. tostring(v) .. '>'
  end

  -- message headers and body
  settings.source = smtp.message({
    headers = {
      to = escape(to),
      subject = subject,
    },
    body = message
  })

  -- fixup from field
settings.from = escape(settings.from)
  settings.rcpt = { escape(to) }

  return smtp.send(settings)
end
Reply


Messages In This Thread
RE: Problem : Email with Wiser for KNX - by rivieraautomation - 16.07.2023, 10:36

Forum Jump: