|
Wednesday, 02 December 2009 19:16 |
|
Mail content text is /tmp/message.txt
# mail -s 'Server Status Report' george@example.com -c Jon@example.com < /tmp/message.txt
Send Mail With Attachment
# !/bin/bash # tar -zcf /tmp/backup.tar.gz /home/david/files # echo | mutt -a /tmp/backup.tar.gz -s “daily backup of data” Jon@example.com
Send Mail (another example)
# echo 'GPS Server ALERT - Root Shell Access on:' `date` `who` | mail -s "Alert: Root Access from `who | cut -d"(" -f2 | cut -d")" -f1`" Jon@example.com
|