mirror of
https://github.com/antos-rde/antosdk-apps.git
synced 2024-11-15 18:08:21 +01:00
17 lines
477 B
Lua
17 lines
477 B
Lua
|
|
local data = ...
|
|
print(data.content)
|
|
for k,v in pairs(data.to) do
|
|
print("sent to:"..v)
|
|
local to = v
|
|
local from = "From: xsang.le@gmail.com\n"
|
|
local suject = "Subject: " .. data.title .. "\n"
|
|
local content = data.content.."\n"
|
|
local cmd = 'echo "' .. utils.escape(from .. suject .. content) .. '"| sendmail ' .. to
|
|
--print(cmd)
|
|
local r = os.execute(cmd)
|
|
if not r then
|
|
print("Cannot send mail to: "..v)
|
|
end
|
|
end
|
|
return "Email sent" |