Hi All,
Not been around in a while. However I have been all over tinternet (google) for days looking for a solution.
Where I work has decided to use Sendmail on our Linux and Unix estate for sending emails via scripts. So I am hoping to eventually get a working solution for Sendmail and not any other program like mailx or mut.
I have installed sharutils to get uuencode working.
Sends subject
echo "Subject: Test from HOST" | sendmail recipient@domain.com
( echo "Subject: Test from HOST" ) | sendmail recipient@domain.com
Sends Subject & Body
MSG=/tmp/temp.txt
echo "This is in the body of the email" >> $MSG
( echo "Subject: Test from HOST"; cat $MSG ) | sendmail recipient@domain.com
Sends Attachments only
uuencode test.txt test.txt | sendmail recipient@domain.com
However I cannot get Attachments & Subject - which to be honest, does make sense to have.
Both send with Subject only
uuencode test.txt test.txt | ( echo "Subject: Test from HOST" ) | sendmail recipient@domain.com
uuencode test.txt test.txt | echo "Subject: Test from HOST" | sendmail recipient@domain.com
I have also tried the following to get an attachment, Subject & Body, but again this does not work, it sends a .dat file which when opened is just the contents withing the code (below) and nothing else
( echo "to: recipient@domain.com"
echo "Subject: Test from HOST"
echo "mime-version: 1.0"
echo "content-type: multiple/related; boundary=messageBoundary"
echo ""
echo "--messageBoundary"
echo "contrent-type: text/plain"
echo ""
echo "Please find the document atttached."
echo ""
echo "--messageBoundary"
echo "content-type: text; name=test.txt"
echo "content-transfer-encoding: base64"
echo ""
openssl base64 < /tmp/test.txt ) | sendmail -t -i
Can anyone help in getting attachments & subjects working with Sendmail or even better, Subject, Body & Attachments