LUA script to send email depending on user session

You can share your Lua Scripts with everybody here.
Post Reply
IEAWingFTPServer
Posts: 1
Joined: Thu Mar 26, 2026 3:35 am

LUA script to send email depending on user session

Post 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
FTP
Site Admin
Posts: 2169
Joined: Tue Sep 29, 2009 6:09 am

Re: LUA script to send email depending on user session

Post 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")
Post Reply