Call local variable in c_sendMail

Please post here if you have problems in using Wing FTP Server.

Call local variable in c_sendMail

Postby sinha_roop » Wed Jul 11, 2012 11:11 am

Thanks for suggesting the below code:
local filepath = "%LastDir"
local filename = string.sub(filepath,string.len(filepath)-string.find(string.reverse(filepath),"/")+2)


Now my question is how can I use filename as a variable in c_sendMail() function.
I have use below code, but this doesn't work.

c_SendMail("rupesh@mysite.com","Any Subject","Any Body - %filename","","smtp_opr")

The above code return %filename itself instead of value of filename.

Please suggest.
sinha_roop
 
posts 6
 
joined Mon Jul 09, 2012 10:36 am

Re: Call local variable in c_sendMail

Postby FTP » Wed Jul 11, 2012 1:46 pm

It should be:

Code: Select all
local filepath = "%LastDir"
local filename = string.sub(filepath,string.len(filepath)-string.find(string.reverse(filepath),"/")+2)
c_SendMail("rupesh@mysite.com","Any Subject","Any Body - "..filename,"","smtp_opr")
FTP
Site Admin
 
posts 1229
 
joined Tue Sep 29, 2009 6:09 am

Re: Call local variable in c_sendMail

Postby sinha_roop » Thu Jul 12, 2012 5:49 am

Thanks a lot!

It works successfully.
sinha_roop
 
posts 6
 
joined Mon Jul 09, 2012 10:36 am


Return to Support

Who is online

Users browsing this forum: No registered users and 4 guests

cron