local Io = require "luan:Io.luan" local Http = require "luan:http/Http.luan" local Mail = require "luan:mail/Mail.luan" local send = Mail.Sender{ host = "smtpcorp.com"; username = "smtp@luanhost.com"; password = "luanhost"; port = 2525; }.send local function form() %>

Upload and Email

Email:

<% end local function sent() %>

Upload and Email

file sent

<% end return function() Io.stdout = Http.response.text_writer() local email = Http.request.parameters.email if email == nil then form() else local file = Http.request.parameters.file send{ from = "smtp@luanhost.com"; to = email; subject = "Upload and Email"; body = "file should be attached"; attachments = {file}; } sent() end end