perl -pi -e 's/\n/\r\n/g'
Example above is changing linux to windows line endings. This came about during my previous post of using base64 to attach ascii text files.
Simple enough.
perl -pi -e 's/\n/\r\n/g'
( echo "to: $recipients"
echo "subject: Report for rsync for from_leads on `date`"
echo "mime-version: 1.0"
echo "content-type: multipart/related; boundary=xBoundaryStringx"
echo
echo "--xBoundaryStringx"
echo "content-type: text/plain"
echo "Body Text"
echo "Body Text"
echo "--xBoundaryStringx"
echo "content-type: text/plain; charset=us-ascii; name=$filename"
echo "content-transfer-encoding: base64"
echo
openssl base64 < $filename ) |sendmail -t -i