Linux and UNIX Systems Configuration Help, How To, Tutorial and Basic Information

  • Decrease font size
  • Default font size
  • Increase font size
  • default color
  • red color
  • green color
Home How To Script
Script
Send Mail Script PDF Print E-mail
Wednesday, 02 December 2009 19:16
AddThis Social Bookmark Button

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
 


Latest News

Friends

Thanks David Ayvazyan for provided useful information and discussions.
www.gnu.am (Armenian Translation)