and here is the mailx version...
:SET &NL# = UC_CRLF()
:SET &MESSAGE# = "Yoho I am an email sent with mailx on &$AGENT#&NL#"
:SET &SUBJECT# = "Test email via &$AGENT#"
:SET &FILE# = "/tmp/testfile.txt"
echo ls &FILE# || exit 55
ls &FILE# || exit 55
:SET &NL# = UC_CRLF()
:SET &MESSAGE# = "Yoho I am an email sent with mailx on &$AGENT#&NL#"
:SET &SUBJECT# = "Test email via &$AGENT#"
:SET &FILE# = "/tmp/testfile.txt"
echo ls &FILE# || exit 55
ls &FILE# || exit 55
(echo "&MESSAGE#") | mailx -v \
-r "uc4@local.com" \
-s "&SUBJECT#" \
-S smtp="XX.XX.XX.XX:587" \
! -S smtp-use-starttls \
-S smtp-auth=login \
-S smtp-auth-user="uc4@local.com" \
-S smtp-auth-password="supermegasecret" \
-S ssl-verify=ignore \
-a &FILE# \
uc4@local.com
I had to comment the following line because of my mail server setup....
! -S smtp-use-starttls