Script Send Mail by Parameters avec Attached file

Hi i have a script for show the information files. ls -l

how do you for to place this result in a file of text and to send it attached for e-mail.

The information of the mail must be in paramentros. for example e-mail to I must write the e-mail, the subject and the motive of the mail!

Someone has an example as do this !

ls -l > file_to_send.txt

check the options to send mail

 
sendmail
mailx