Page 1 of 1

LUA script to send email depending on user session

Posted: Thu Mar 26, 2026 3:47 am
by IEAWingFTPServer
I have this LUA script to look at user session and send an email when a file is uploaded to two different email adressess. It is not working, no email.

However, when I use the Send Email option not LUA script, it works. But with that it will send when anyone uploads a file.

What did I do wrong?

if "%Name" == "FTPA" then
c_SendMail("test@test.org","A file was uploaded.","%Name uploaded %PathName","","LocalSMTPServer")
elseif "%Name" == "FTPD" then
c_SendMail("test2@test.org","A file was uploaded.","%Name uploaded %PathName","","LocalSMTPServer")
end

Re: LUA script to send email depending on user session

Posted: Fri Apr 17, 2026 1:38 pm
by FTP
The script seems fine. So could you send email via following script with "Administration > Console"?

c_SendMail("test@test.org","A file was uploaded.","%Name uploaded %PathName","","LocalSMTPServer")