How to send mail with attachment in Unix

Hi All,
Is it possible to send mail in Unix with attachment.
If yes, then how??

Try like..

mail -s "hi"  test@gmail.com< test1.txt

But the file is not attached in this code

check test1.txt is the file...

That i know, But i want that when the mail should come it should contain the attached file.

This shul work

uuencode filename filename.txt | mailx -s " SUBJECT" -r nik@abc.com ram@abc.com

try with mutt command

i tried it's working for me

uuencode test.xsl test.xsl | mail -s " hi" test@gmail.com

If you search the site, there are lots of e-mail examples. Try this to attach a file called data.txt:

#!/bin/ksh

# Convert line feeds from the source and write to attach.out if the file originated
# on Windows
unix2dos -437 -ascii data.txt attach.out

# Now uuencode attach.out and call it data.txt for the attachment name.
(print "Please review the attached file";uuencode attach.out data.txt) | mailx -s "Test" myemail@mydomain.com

exit 0