我想使用套接字库从lua向gmail帐户发送电子邮件。
smtp = require("socket.smtp")
address = { "<someone@gmail.com>" }
from = { "<someone@gmail.com>" }
theMessage = {
headers = {
to = "YOU",
cc = '"him" ',
subject = "I got something to tell you..."
},
body = "You're the best."
}
r, e = smtp.send{ from = from, rcpt = address, source = smtp.message(theMessage)}
当我这样做的时候 打印(e)中
“拒绝连接”。
print(r)
零 有什么想法吗?
我只是按照网站上的说明操作: http://w3.impa.br/~diego/software/luasocket/smtp.html
答案 0 :(得分:1)
您可能需要在smtp.send
函数
smtp.send{
from = from,
rcpt = address,
source = smtp.message(theMessage),
server = 127.0.0.1,
port = 25
}