Sending mail from a Bash shell script

前端 未结 12 1813
梦毁少年i
梦毁少年i 2021-01-29 22:54

I am writing a Bash shell script for Mac that sends an email notification by opening an automator application that sends email out with the default mail account in Mail.app. The

12条回答
  •  忘了有多久
    2021-01-29 23:48

    Here's a modified shells script snip I've used on various UNIX systems... (echo "${MESSAGE}" | ${uuencode} ${ATTACHMENT}$basename ${ATTACHMENT}) | ${mailx} -s "${SUBJECT}" "${TO_LIST}"

    uuencode and mailx are set to the executables. The other variables are from user input parsed using getopts.

    This does work but I have to admit more often than not I use a simple Java program to send console emails.

提交回复
热议问题