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 notification
#7
I installed this package and I am using this script:
Code:
-- send an e-mail
function mail(to, subject, message)
 -- make sure these settings are correct
 local settings = {
   -- "from" field, only e-mail must be specified here
   from = 'my@gmail.com',
   -- smtp username
   user = 'my@gmail.com',
   -- smtp password
   password = 'my_password',
   -- smtp server
   server = 'smtp.gmail.com',
   -- smtp server port
   port = 465,
   -- enable ssl, required for gmail smtp
   secure = 'sslv23',
 }

 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


and when I am trying to use this script I have the answer:
Code:
* arg: 1
 * nil
* arg: 2
 * string: revcd alert fatal error
Reply


Messages In This Thread
email notification - by Peter - 22.02.2016, 17:55
RE: email notification - by admin - 23.02.2016, 07:56
RE: email notification - by PassivPluss - 18.10.2016, 20:13
RE: email notification - by PassivPluss - 26.10.2016, 20:44
RE: email notification - by admin - 27.10.2016, 07:16
RE: email notification - by AEK - 27.10.2016, 07:43
RE: email notification - by buuuudzik - 27.10.2016, 16:33
RE: email notification - by admin - 27.10.2016, 18:02
RE: email notification - by buuuudzik - 27.10.2016, 18:03
RE: email notification - by admin - 27.10.2016, 18:15
RE: email notification - by buuuudzik - 27.10.2016, 21:12
RE: email notification - by admin - 28.10.2016, 06:42
RE: email notification - by buuuudzik - 28.10.2016, 06:55
RE: email notification - by PassivPluss - 30.10.2016, 06:04

Forum Jump: