Almost there.
This commit is contained in:
parent
84f03fda7c
commit
6c565dd7c0
11 changed files with 20 additions and 14 deletions
|
@ -6,10 +6,9 @@
|
|||
-- RCS ID: $Id$
|
||||
-----------------------------------------------------------------------------
|
||||
-- make sure LuaSocket is loaded
|
||||
if not LUASOCKET_LIBNAME then error('module requires LuaSocket') end
|
||||
require("luasocket")
|
||||
-- get LuaSocket namespace
|
||||
local socket = _G[LUASOCKET_LIBNAME]
|
||||
if not socket then error('module requires LuaSocket') end
|
||||
|
||||
-- require other modules
|
||||
require("ltn12")
|
||||
|
|
|
@ -6,10 +6,9 @@
|
|||
-- RCS ID: $Id$
|
||||
-----------------------------------------------------------------------------
|
||||
-- make sure LuaSocket is loaded
|
||||
if not LUASOCKET_LIBNAME then error('module requires LuaSocket') end
|
||||
require("luasocket")
|
||||
-- get LuaSocket namespace
|
||||
local socket = _G[LUASOCKET_LIBNAME]
|
||||
if not socket then error('module requires LuaSocket') end
|
||||
|
||||
-- require other modules
|
||||
require("ltn12")
|
||||
|
|
|
@ -6,10 +6,11 @@
|
|||
-- RCS ID: $Id$
|
||||
-----------------------------------------------------------------------------
|
||||
-- make sure LuaSocket is loaded
|
||||
if not LUASOCKET_LIBNAME then error('module requires LuaSocket') end
|
||||
require"luasocket"
|
||||
-- get LuaSocket namespace
|
||||
local socket = _G[LUASOCKET_LIBNAME]
|
||||
if not socket then error('module requires LuaSocket') end
|
||||
|
||||
require"ltn12"
|
||||
|
||||
-- create smtp namespace inside LuaSocket namespace
|
||||
local smtp = socket.smtp or {}
|
||||
|
@ -18,6 +19,7 @@ socket.smtp = smtp
|
|||
setmetatable(smtp, { __index = _G })
|
||||
setfenv(1, smtp)
|
||||
|
||||
|
||||
-- default server used to send e-mails
|
||||
SERVER = "localhost"
|
||||
-- default port
|
||||
|
|
|
@ -5,13 +5,11 @@
|
|||
-- Conforming to: RFC 2396, LTN7
|
||||
-- RCS ID: $Id$
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
-- make sure LuaSocket is loaded
|
||||
if not LUASOCKET_LIBNAME then error('module requires LuaSocket') end
|
||||
require"luasocket"
|
||||
-- get LuaSocket namespace
|
||||
local socket = _G[LUASOCKET_LIBNAME]
|
||||
if not socket then error('module requires LuaSocket') end
|
||||
-- create smtp namespace inside LuaSocket namespace
|
||||
-- create url namespace inside LuaSocket namespace
|
||||
local url = socket.url or {}
|
||||
socket.url = url
|
||||
-- make all module globals fall into smtp namespace
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue