Page 1 of 1

Call local variable in c_sendMail

Posted: Wed Jul 11, 2012 11:11 am
by sinha_roop
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.

Re: Call local variable in c_sendMail

Posted: Wed Jul 11, 2012 1:46 pm
by FTP
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")

Re: Call local variable in c_sendMail

Posted: Thu Jul 12, 2012 5:49 am
by sinha_roop
Thanks a lot!

It works successfully.