webmcp
changeset 558:b7596f5158d4
Added argument "raw_headers" to net.send_mail(...)
author | jbe |
---|---|
date | Tue Jun 09 13:13:36 2020 +0200 (2020-06-09) |
parents | c839cbd66598 |
children | 318fdbb5f0f4 |
files | framework/env/encode/mime/mail.lua framework/env/net/send_mail.lua |
line diff
1.1 --- a/framework/env/encode/mime/mail.lua Tue Feb 18 18:16:36 2020 +0100 1.2 +++ b/framework/env/encode/mime/mail.lua Tue Jun 09 13:13:36 2020 +0200 1.3 @@ -60,6 +60,11 @@ 1.4 parts[#parts+1] = mbl("Cc", args.cc) 1.5 parts[#parts+1] = mbl("Bcc", args.bcc) 1.6 parts[#parts+1] = un("Subject", args.subject) 1.7 + if args.raw_headers then 1.8 + for i, raw_header in ipairs(args.raw_headers) do 1.9 + parts[#parts+1] = raw_header 1.10 + end 1.11 + end 1.12 parts[#parts+1] = "MIME-Version: 1.0\r\n" 1.13 encode_container(parts, args) 1.14 return table.concat(parts)
2.1 --- a/framework/env/net/send_mail.lua Tue Feb 18 18:16:36 2020 +0100 2.2 +++ b/framework/env/net/send_mail.lua Tue Jun 09 13:13:36 2020 +0200 2.3 @@ -9,6 +9,7 @@ 2.4 cc = cc, -- Cc header address or table with 'name' and 'address' fields 2.5 bcc = bcc, -- Bcc header address or table with 'name' and 'address' fields 2.6 subject = subject, -- subject of e-mail 2.7 + raw_headers = raw_headers, -- sequence of raw header lines 2.8 multipart = multipart_type, -- "alternative", "mixed", "related", or nil 2.9 content_type = content_type, -- only for multipart == nil, defaults to "text/plain" 2.10 binary = binary, -- allow full 8-bit content