17.11.2019, 11:30
(This post was last modified: 17.11.2019, 11:41 by josemabera.)
(16.11.2019, 22:01)Erwin van der Zwart Wrote: Hi,Hi Erwin
Under System -> Network -> Interfaces you can double click on the NIC eth0 and there you can set the DNS and default GW (Gateway). When this is not set your controller can’t communicate with the internet and makes it impossible to send mail to Gmail (:
BR,
Erwin
If is configured
DNS1= 8.8.8.8
DNS2 = 8.8.4.4
and the GW also is configured
Even so it doesn't work, I can't attach Image captures to show you
(16.11.2019, 20:32)Tokatubs Wrote:Hi TokatubsThis works great for me, with gmail. Could the error be the secure line i see that you use sslCode:-- 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 = 'example@gmail.com',
-- smtp username
user = 'example@gmail.com',
-- smtp password
password = 'mypassword',
-- smtp server
server = 'smtp.gmail.com',
-- smtp server port
port = 465,
-- enable tls, required for gmail smtp
secure = 'tlsv1_2',
}
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
-- fixup from field
local from = '<' .. tostring(settings.from) .. '>'
-- message headers and body
settings.source = smtp.message({
headers = {
to = table.concat(to, ', '),
subject = subject,
['From'] = from,
['Content-type'] = 'text/html; charset=utf-8',
},
body = message
})
settings.from = from
settings.rcpt = to
return smtp.send(settings)
end
I don't understand exactly what you tell me about the ssl Secure Line, how can I modify it to test what you tell me?
BR
Josema