#! /bin/ksh

#
# Name        : ${HOME}/bin/sendMail.ksh
#
# Version     : 1.0
#
# Author      : Gerard van Wageningen
#
# Description : Simple sendmail front-end
#
# 1.0   First Version
#

TO="${TO:-${USER}}"
FILE="${FILE:-.profile}"
cat << __EOF__ | sendmail -t -oi
From: ${USER}
To: ${TO}
Subject: File: ${FILE}
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary=\"1234567890\"
Content-Transfer-Encoding: 8bit
User-Agent: Command line 

--1234567890
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

Testing 123

--1234567890
Content-Type: application/octet-stream; name=\"${FILE}\"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename=\"${FILE}\"

$( /opt/freeware/bin/openssl base64 -e -in ${FILE} )
--1234567890--
__EOF__

exit $?

######################### EOF #########################

