16.09.2022, 08:49
Try this:
Code:
to = {
escape('user1@example.com'),
escape('user2@example.com'),
}
msgt = {
headers = {
to = table.concat(to, ', '),
['content-type'] = 'text/csv',
['content-disposition'] = 'attachment; filename="logs.csv"',
['content-transfer-encoding'] = 'BASE64',
subject = subject,
},
body = ltn12.source.chain(
ltn12.source.string(csv),
ltn12.filter.chain(mime.encode('base64'), mime.wrap('base64'))
)
}
settings.source = smtp.message(msgt)
settings.from = escape(settings.from)
settings.rcpt = to