Friday, November 4, 2011

send email automatically in linux

1. mail
mail -s "test" test@test.com < messge.txt mail -s "test" test@test.com <test
>test
>test
>EOF

2. mutt
mutt -s "test" -a test.log test@test.com < message.txt mutt -s "test" -a test.log test@test.com <test
>test
>test
>EOF

ATTN: uuencode can be used with mail to attach file, but it was not installed by default. To install uuencode, install package: sharutils

reference:
http://www.cyberciti.biz/tips/sending-mail-with-attachment.html
http://www.thegeekstuff.com/2009/12/how-to-send-an-email-with-attachment-and-body-from-linux/

No comments:

Post a Comment