21.11.2017, 14:36
Hi all,
Can you help me to find the mistake in my script ?
Thanks
function Email(to, subject, message)
-- make sure these settings are correct
---------------BEGINNING OF USER EDITABLE AREA-------------------
local settings = {
-- "from" field, only e-mail must be specified here
from = 'bouvet.clementine@gmail.com',
-- smtp username
user = 'bouvet.clementine@gmail.com',
-- smtp password
password = 'xxxxx',
-- 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
Can you help me to find the mistake in my script ?
Thanks
function Email(to, subject, message)
-- make sure these settings are correct
---------------BEGINNING OF USER EDITABLE AREA-------------------
local settings = {
-- "from" field, only e-mail must be specified here
from = 'bouvet.clementine@gmail.com',
-- smtp username
user = 'bouvet.clementine@gmail.com',
-- smtp password
password = 'xxxxx',
-- 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