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.

mail without password and secure
#1
Hi,

 is there an old script that works otday for send an email to an STMP without password and secure ?

function mail(to, subject, message)
  -- make sure these settings are correct
    local settings = {
    -- "from" field, only e-mail must be specified here
    from = 'MAIL@SEND.COM',
    -- smtp username
    user = ' MAIL@SEND.COM ',
    -- smtp password
    password = nil,   -- NO PASSWORD
    -- smtp server
    server = 'IP_SMTP',
    -- smtp server port
    port = 25,
    -- enable ssl, NO SECURE
    --secure = nil,
  }
KNX Advanced Partner + Tutor
Reply
#2
No authentication will be performed if password is nil. Try setting it to an empty string. Check that you don't have spaces inside of the user field value.
Reply
#3
Thank you your assistance !!

I receive this from: log(res,err)

Event for oneShot test mail (32/1/25) 23.07.2025 16:09:01
* arg: 1
* nil
* arg: 2
* nil

with
password = ''

I receive:
* arg: 1
* string: Could not send email:
* arg: 2
* string: authentication not supported
* arg: 3
* string:
KNX Advanced Partner + Tutor
Reply
#4
Add this before return smtp.send(settings) to log all SMTP communication and post what you get in Logs:

Code:
settings.create = function()
  local sock = socket.tcp()

  return {
    settimeout = function(_, ...)
      return sock:settimeout(...)
    end,
    connect = function(_, ...)
      return sock:connect(...)
    end,
    close = function(_, ...)
      return sock:close(...)
    end,
    receive = function(_, ...)
      local res, err, partial, time = sock:receive(...)
      log('receive', res, err, partial)
      return res, err, partial, time
    end,
    send = function(_, ...)
      log('send', ...)
      return sock:send(...)
    end
  }
end
Reply
#5
strange but good....now it works !
KNX Advanced Partner + Tutor
Reply


Forum Jump: