I am able to attache the file in UNIX/LINUX script using following code.
MAILFORMAT="Please do not replay this mail.This mail is auto generated."
echo -e $MAILFORMAT | mailx -r autoreplay@gmail.com -a filename -s "status" xyz@gmail.com
But same I am not able attache the file in Sunos system in script.
Solaris mailx does not have -a option.
But the following seems to work
MAILFORMAT="Please do not replay this mail.This mail is auto generated."
FILENAME=file.csv
mailx -r autoreplay@gmail.com -s "status" xyz@gmail.com << _EOM
$MAILFORMAT
`uuencode $FILENAME $FILENAME`
_EOM