Sample Header Ad - 728x90

how to send a mail with attachment using sendmail command in unix

2 votes
6 answers
35072 views
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?
Asked by Kalishwari (41 rep)
May 3, 2018, 04:40 AM
Last activity: Jun 11, 2024, 05:04 PM