Maybe this can help:
-- load the smtp support
local smtp = require("socket.smtp")
from = "<coloque_o_seu_email_aqui_nao_use_o_de_outras_pessoas@xxx.com>"
rcpt = {
"<coloque_um_email_aqui_nao_use_o_de_outras_pessoas@xxx.com>",
"<coloque_um_email_aqui_nao_use_o_de_outras_pessoas@xxx.com>",
"<coloque_um_email_aqui_nao_use_o_de_outras_pessoas@xxx.com>"
}
mesgt = {
headers = {
to = "Fulano da Silva <coloque_um_email_aqui_nao_use_o_de_outras_pessoas@xxx.com>",
cc = '"Beltrano F. Nunes" <coloque_um_email_aqui_nao_use_o_de_outras_pessoas@xxx.com>',
subject = "My first message"
},
body = "I hope this works. If it does, I can send you another 1000 copies."
}
r, e = smtp.send{
from = from,
rcpt = rcpt,
source = smtp.message(mesgt)
user = "usuario_valido_em_algum_servidor_de_email_que+voce_tenha_acesso",
password = "senhaqui",
server = "servidor_smtp_onde_voce_tenha_acesso_smtp.google.com_por_exemplo",
port = 465, -- pode ser outra porta
create = sslCreate
}
I put in the Github for future reference.
I do not know if I would send it without encryption in this case. I do not know if this library is complete. She doesn’t say anything about SSL and without this protocol it will be difficult to use any server nowadays.
If you read the documentation, you will see that there are other things that need to be done. Just copying done example does not solve everything. You have to study existing material and adapt to what you need.
Doesn’t generate any errors? Enough to send? I think only this won’t really solve it. You need to set and authenticate on the server. This example only works if specific circumstance, it is not there to resolve any situation.
– Maniero