mirror of
https://github.com/lunarmodules/luasocket.git
synced 2024-12-26 20:38:22 +01:00
doesn't fail on windows.
This commit is contained in:
parent
8841e0f3c1
commit
e70d404a10
@ -1,3 +1,6 @@
|
|||||||
|
require("smtp")
|
||||||
|
require("mime")
|
||||||
|
|
||||||
mesgt = {
|
mesgt = {
|
||||||
headers = {
|
headers = {
|
||||||
to = "D Burgess <db@werx4.com>",
|
to = "D Burgess <db@werx4.com>",
|
||||||
@ -10,12 +13,12 @@ mesgt = {
|
|||||||
},
|
},
|
||||||
[2] = {
|
[2] = {
|
||||||
headers = {
|
headers = {
|
||||||
["content-type"] = 'application/octet-stream; name="luasocket"',
|
["content-type"] = 'application/octet-stream; name="testmesg.lua"',
|
||||||
["content-disposition"] = 'attachment; filename="luasocket"',
|
["content-disposition"] = 'attachment; filename="testmesg.lua"',
|
||||||
["content-transfer-encoding"] = "BASE64"
|
["content-transfer-encoding"] = "BASE64"
|
||||||
},
|
},
|
||||||
body = ltn12.source.chain(
|
body = ltn12.source.chain(
|
||||||
ltn12.source.file(io.open("luasocket", "rb")),
|
ltn12.source.file(io.open("testmesg.lua", "rb")),
|
||||||
ltn12.filter.chain(
|
ltn12.filter.chain(
|
||||||
mime.encode("base64"),
|
mime.encode("base64"),
|
||||||
mime.wrap()
|
mime.wrap()
|
||||||
@ -41,10 +44,6 @@ mesgt = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
-- sink = ltn12.sink.file(io.stdout)
|
|
||||||
-- source = ltn12.source.chain(socket.smtp.message(mesgt), socket.smtp.stuff())
|
|
||||||
-- ltn12.pump.all(source, sink)
|
|
||||||
|
|
||||||
print(socket.smtp.send {
|
print(socket.smtp.send {
|
||||||
rcpt = "<diego@cs.princeton.edu>",
|
rcpt = "<diego@cs.princeton.edu>",
|
||||||
from = "<diego@cs.princeton.edu>",
|
from = "<diego@cs.princeton.edu>",
|
||||||
|
Loading…
Reference in New Issue
Block a user