send automatic mail

Post here if you have some suggestions or you want to request a new feature.
Post Reply
CCURAU
Posts: 1
Joined: Sun Feb 23, 2025 9:19 pm

send automatic mail

Post by CCURAU »

I recently use GENE6 ftp server in which a very usefull fonction is included.
Every user can select if he want to receive an automatic email when another user deposit a new document in the server.
You can also send a message to the document's owner when othres user download or read his documents.
This function can be included in the NOTES user section and use the emails enclosed .
An automatic mail can be generate at the domain or server level

Best regards
FTP
Site Admin
Posts: 2118
Joined: Tue Sep 29, 2009 6:09 am

Re: send automatic mail

Post by FTP »

OK, first you need to define the email addresses for every account under "User -> Notes -> Email address", and then use the following lua script in the event "OnFileUploaded":

Code: Select all

local domain = "%Domain"
local strUserlist = c_GetUserList(domain) 
local userlist = Split(strUserlist,"\n") 

for _,username in pairs(userlist) do 
	local user = c_GetUser(domain, username)
	if user ~= nil and user.note_email ~= nil and user.note_email ~= "" then 
		c_SendMail(user.note_email,"a file has been uploaded","%Name uploaded the file %FileName","","SMTP_CONFIG") 
	end
end

Here, "SMTP_CONFIG" is the SMTP configuration name under "Servers -> Settings -> SMTP Manager". If you have lots of user accounts, it may take a while to send all the emails.
Post Reply