Mailing the output which is there in remote server

Hi all,

I have a script which logs in to the remote server with FTP and with the user id/password and list the files in the path of remote server where thefiles resid.i need to email this output(i.e wether the files are present on not under the path) to my email id. Can u please let me know as to how i go about this..

Thanks in advance for your help.

#!/bin/ksh
ftp -in Remote Server << end-of-input
user Userid password

cd <path in Remote directory where files reside>
verbose
dir
bye
end-of-input

Try this:

ftp -n nodename <<EOF > t.lis
user username pwd
verbose 
dir
bye 
EOF 

mailx -s 'file list' me@myplace.com < t.lis

I dont see the mail being generated..not sure where the problem is...do u have any idea