This is how I try to send, email with sendmail command.
echo "Dear user, please find the attached file. Thanks, Support team " | mailx -s "x12 extract for 837 transaction" -a $LogFilePath/file.csv $email_id
but i am getting the error as "-a illegal operation" checked with man mailx command there is no flag like -a and there flag for attachment.
so I have tried with sendmail command
( echo $email_id #From: $email_from_recipients echo "MIME-Version: 1.0" echo "Content-Type: text/html; charset=us-ascii" echo Subject: Report $LogFilePath/file.csv ) | /usr/lib/sendmail -t
it was not sending the file as attachment.
the contents of the csv file is displayed in the body of the mail with comma separated one.
how to send the attachment with sendmail command in unix?