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?
#1
I am using the standard script to send email. LM5 v20191015.

No matter what host I set in server, I get an error about "string: 535-5.7.8 Username and Password not accepted. Learn more at
535 5.7.8  https://support.google.com/mail/?p=BadCredentials c5sm15367699wrs.73 - gsmtp"


Why on earth would GOOGLE be there if I ask it to go to "sss" ???

How can I debug this?
I have tried all the combination of 'secure' found on the forum in various posts over the years; this is really confusing but in any case does not change anything since GOOGLE is always back as error.

Thanks for any help or pointers




function mail(to, subject, message)
  -- make sure these settings are correct

  local settings = {

    -- "from" field, only e-mail must be specified here

    from = '...',

    -- smtp username

    user = '...',

    -- smtp password

    password = '...',

    -- smtp server

    server = 'sss',

    -- smtp server port

    port = 465,

    secure = 'tlsv12',

    -- use STARTTLS mode

    --starttls = true,



  }



  local smtp = require('socket.smtp')



  if type(to) ~= 'table' then

    to = { to }

  end



  for index, email in ipairs(to) do

    to[ index ] = '<' .. tostring(email) .. '>'

  end



  -- message headers and body

  settings.source = smtp.message({

    headers = {

      to = table.concat(to, ', '),

      subject = subject,

      ['Content-type'] = 'text/html; charset=utf-8',

    },

    body = message

  })



  -- fixup from field

  settings.from = '<' .. tostring(settings.from) .. '>'

  settings.rcpt = to



  return smtp.send(settings)
end
Reply


Messages In This Thread
email? - by Fred - 08.05.2021, 21:44
RE: email? - by Erwin van der Zwart - 09.05.2021, 08:28

Forum Jump: