MoinMoin Logo
  • Comments
  • Immutable Page
  • Menu
    • Navigation
    • RecentChanges
    • FindPage
    • Local Site Map
    • Help
    • HelpContents
    • HelpOnMoinWikiSyntax
    • Display
    • Attachments
    • Info
    • Raw Text
    • Print View
    • Edit
    • Load
    • Save
  • Login

Navigation

  • Start
  • Sitemap
Revision 1 as of 2013-09-03 19:59:20
  • CommandLineMail

CommandLineMail

Examples of sending email through a script on Linux.

Example 1

   1 #!/bin/sh
   2 CURRDATE=`date -u "+%Y-%m-%dT%H:%m:%S.%Z"`
   3 FILE=/tmp/reportx$CURRDATE.txt
   4 SUBJECT="Report subject"
   5 BODY="Report body ...."
   6 MAILDESTINATION="dest1@example.org dest2@example.org"
   7 /usr/bin/python /home/user/script.py > $FILE
   8 echo $BODY | /bin/mail -a $FILE -s "$SUBJECT" -- $MAILDESTINATION
  • MoinMoin Powered
  • Python Powered
  • GPL licensed
  • Valid HTML 4.01