Ah ha! Thanks. That works perfectly and with zero setup tinkering!
For anyone wanting to do this, here is how:
On your Ubuntu server, type the following as the root user:
Code:
aptitude -y install sendemail
To see if it works, type the following:
Code:
sendemail -f root@myserver -t MyTargetAddress@MyDomain.com -u "This is the Subject" -m "This is the body of the email" -s 192.168.107.14:25
The IP address should be your Zimbra server, and port 25 is the default so you don't need to specify if that is what it is, but if not, this is how you do.
Typing "which sendemail" shows that the program is installed to /usr/bin/sendemail which is in the default path and should work in the crontab scheduler...if not, you can either use the full path or add the path environment in the cron schedule itself.
Script example:
Code:
## Obtain the full path to sendemail. ##
SENDEMAIL=$(which sendemail)
## Setup variables. ##
FROMADDR="root@myserver"
TOADDR="webmaster@mydomain.com;administrator@mydomain.com;backup@mydomain.com"
EMAILSERVER="192.168.107.14"
EMAILPORT="25"
## Send an email. ##
${SENDEMAIL} -f ${FROMADDR} -t ${TOADDR} -u "Test Subject" -m "This is a test.\nThis is the 2nd line\nThis is the 3rd line" -s ${EMAILSERVER}:${EMAILPORT} LHammonds