lua-resty-smtp
lua-resty-smtp copied to clipboard
smtp.lua:124: 500 Error: bad syntax
`ngx.header.content_type="application/json;charset=utf8"; local function send_mail() local smtp = require("resty.smtp") local mime = require("resty.smtp.mime") local ltn12 = require("resty.smtp.ltn12")
ngx.log(ngx.ERR, "Sending test mail...")
local subject = "mail with attachment"
local body = "mail plain text body"
local from ="[email protected]"
local to = {"[email protected]"}
local attachment_content_type = "text/plain"
local attachment_file_name = "README.md"
local attachment = "You got me"
local mesgt = {
headers= {
subject= mime.ew(subject, nil,
{ charset= "utf-8" }),
["content-transfer-encoding"]= "BASE64",
["content-type"]= "text/plain; charset='utf-8'",
},
body= mime.b64("aaaaa")
}
local ret, err = smtp.send {
from = from,
rcpt = to,
user =from,
password = '********',
server ='smtp.mxhichina.com',
port = 25,
domain = "*.*.*.*",
source = smtp.message(mesgt),
ssl = { enable = false , verify_cert = false }
}
ngx.log(ngx.ERR, from,"111111")
if err then
ngx.log(ngx.ERR, err,"111111")
end
end
send_mail()
ngx.say("OK") ngx.exit(200) `
Anyway, I try to modify the domain, server, and recipient formats to report syntax errors. However, using python code to try to send mail can be sent successfully.
i got this problem too,is this project still alive?