How to send the output from a cronjob to multiple e-mail addresses?

In the beginning of a crontab file you could use the MAILTO instruction to indicate you want the output to be sent as an e-mail to an e-mail address. I would like to send the output to multiple addresses. Is it possible (and how) to specify multiple addresses?


It may differ depending exactly which cron daemon package you use, but this is from the manpage of Vixie Cron on Ubuntu Hardy:

If MAILTO is defined (and non-empty), mail is sent to the user so named. MAILTO may also be used to direct mail to multiple recipients by separating recipient users with a comma. If MAILTO is defined but empty (MAILTO=""), no mail will be sent. Otherwise mail is sent to the owner of the crontab.

If you're not using Vixie Cron, or aren't sure, try the manual page for the crontab file: man 5 crontab

Example

MAILTO="[email protected],[email protected]"

As an alternative to the above answers, you can send email to a single address which is a mail group or distribution list. This works especially well if you manage multiple servers since it is easier to manage addresses on your mail server rather than in crontab of each individual machine.