diff options
Diffstat (limited to 'src/smtp.lua')
-rw-r--r-- | src/smtp.lua | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/smtp.lua b/src/smtp.lua index 1d1905e..8b5e622 100644 --- a/src/smtp.lua +++ b/src/smtp.lua | |||
@@ -6,10 +6,11 @@ | |||
6 | -- RCS ID: $Id$ | 6 | -- RCS ID: $Id$ |
7 | ----------------------------------------------------------------------------- | 7 | ----------------------------------------------------------------------------- |
8 | -- make sure LuaSocket is loaded | 8 | -- make sure LuaSocket is loaded |
9 | if not LUASOCKET_LIBNAME then error('module requires LuaSocket') end | 9 | require"luasocket" |
10 | -- get LuaSocket namespace | 10 | -- get LuaSocket namespace |
11 | local socket = _G[LUASOCKET_LIBNAME] | 11 | local socket = _G[LUASOCKET_LIBNAME] |
12 | if not socket then error('module requires LuaSocket') end | 12 | |
13 | require"ltn12" | ||
13 | 14 | ||
14 | -- create smtp namespace inside LuaSocket namespace | 15 | -- create smtp namespace inside LuaSocket namespace |
15 | local smtp = socket.smtp or {} | 16 | local smtp = socket.smtp or {} |
@@ -18,6 +19,7 @@ socket.smtp = smtp | |||
18 | setmetatable(smtp, { __index = _G }) | 19 | setmetatable(smtp, { __index = _G }) |
19 | setfenv(1, smtp) | 20 | setfenv(1, smtp) |
20 | 21 | ||
22 | |||
21 | -- default server used to send e-mails | 23 | -- default server used to send e-mails |
22 | SERVER = "localhost" | 24 | SERVER = "localhost" |
23 | -- default port | 25 | -- default port |