I am trying to send a mail with attachment using sendmail. The problem is I am unable to send a subject line along with this.
The following command line fires two mails instead of one - one with the "Subject : Report", and the other with the attachment:
/usr/bin/gmime-uuencode "/tmp/url_by_ip.txt" "Report.txt" | echo "Subject: Report" | /usr/sbin/sendmail <sender> <receiver>
Try this:
mail -s 'Report' [email protected] < tmp/url_by_ip.txt