Logic Machine Forum
mail without password and secure - Printable Version

+- Logic Machine 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: mail without password and secure (/showthread.php?tid=6058)



mail without password and secure - toujour - 23.07.2025

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,
  }


RE: mail without password and secure - admin - 23.07.2025

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.


RE: mail without password and secure - toujour - 23.07.2025

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:


RE: mail without password and secure - admin - 24.07.2025

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



RE: mail without password and secure - toujour - 25.07.2025

strange but good....now it works !