mirror of
https://github.com/antos-rde/antosdk-apps.git
synced 2025-07-13 06:04:26 +02:00
move some optional packages to new repository
This commit is contained in:
17
Blogger/api/sendmail.lua
Normal file
17
Blogger/api/sendmail.lua
Normal file
@ -0,0 +1,17 @@
|
||||
|
||||
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"
|
Reference in New Issue
Block a user