Linux #sendemail2012-12-24 11:23
   SendEmail is a lightweight, command line SMTP email client. If you have the need to send email from a command line, this 
free program is perfect: simple to use and feature rich. It was designed to be used in bash scripts, batch files, Perl 
programs and web sites, but is quite adaptable and will likely meet your requirements. SendEmail is written in Perl and is 
unique in that it requires NO MODULES. It has an intuitive and flexible set of command-line options, making it very easy to 
learn and use.
    SendEmail is licensed under the GNU GPL, either version 2 of the License or (at your option) any later version.
    [Supported Platforms: Linux, BSD, OS X, Windows 98, Windows NT, Windows 2000, & Windows XP] 



  SendEmail is a perl script/program, and only needs to be copied to a directory
  in your path to make it accessible.  Most likely the following steps will
  be sufficient:
  1) Extract the package
      tar -zxvf sendEmail-v1.XX.tar.gz
  2) Copy the sendEmail script to /usr/local/bin
      cp -a sendEmail-v1.XX/sendEmail /usr/local/bin
  3) Make sure its executable
      chmod +x /usr/local/bin/sendEmail
  4) Run it

  robin@SZDB:~/dba_scripts/sendEmail-v1.56> ./sendEmail
  sendEmail-1.56 by Brandon Zehm <>
  Synopsis:  sendEmail -f ADDRESS [options]
      -f ADDRESS                from (sender) email address
      * At least one recipient required via -t, -cc, or -bcc
      * Message body required via -m, STDIN, or -o message-file=FILE
      -t ADDRESS [ADDR ...]     to email address(es)
      -u SUBJECT                message subject
      -m MESSAGE                message body
      -s SERVER[:PORT]          smtp mail relay, default is localhost:25
      -a   FILE [FILE ...]      file attachment(s)
      -cc  ADDRESS [ADDR ...]   cc  email address(es)
      -bcc ADDRESS [ADDR ...]   bcc email address(es)
      -xu  USERNAME             username for SMTP authentication
      -xp  PASSWORD             password for SMTP authentication
      -b BINDADDR[:PORT]        local host bind address
      -l LOGFILE                log to the specified file
      -v                        verbosity, use multiple times for greater effect
      -q                        be quiet (i.e. no STDOUT output)
      -o NAME=VALUE             advanced options, for details try: --help misc
          -o message-content-type=<auto|text|html>
          -o message-file=FILE         -o message-format=raw
          -o message-header=HEADER     -o message-charset=CHARSET
          -o reply-to=ADDRESS          -o timeout=SECONDS
          -o username=USERNAME         -o password=PASSWORD
          -o tls=<auto|yes|no>         -o fqdn=FQDN
      --help                    the helpful overview you're reading now
      --help addressing         explain addressing and related options
      --help message            explain message body input and related options
      --help networking         explain -s, -b, etc
      --help output             explain logging and other output options
      --help misc               explain -o options, TLS, SMTP auth, and more

  ./sendEmail --help addressing
  ./sendEmail --help message

  robin@SZDB:~> sendEmail -f \
  > -t \
  > -u "Test Mail" \
  > -m "This is a test mail from Robinson"
  Dec 18 14:10:23 szdb sendEmail[18494]: Email was sent successfully!
  robin@SZDB:~> sendEmail -f \
  > -t \
  > -u "Test Mail" \
  > -s \
  > -xu jackson \
  > -xp temp_000 \
  > -m "This is test mail from Robinson"
  Dec 18 14:13:24 szdb sendEmail[18500]: Email was sent successfully!
  robin@SZDB:~> sendEmail -f \                                                                   
  > -t "Robinson cheng <>" \
  > -u "Send email to mutiple people" \
  > -m "This is a test mail" 
  Dec 18 14:24:57 szdb sendEmail[18537]: Email was sent successfully!
  robin@SZDB:~> sendEmail -f \
  > -t "Robinson cheng <>" \
  > -cc \
  > -bcc \
  > -u "Test mail " \
  > -m "This is a test mail"
  robin@SZDB:~> sendEmail -f \
  > -t "Robinson cheng <>" \
  > -cc \
  > -u "Test mail with multi attached" \
  > -m "This is a test mail with multi attached" \
  > -a /users/robin/addmrpt_1_11584_11649.txt "/users/robin/Temp log"
  Dec 18 14:43:35 szdb sendEmail[18664]: Email was sent successfully!
  robin@SZDB:~> sendEmail -f \
  > -t "Robinson cheng <>" \
  > -u "Test mail and the body from file contents" \
  > -o message-file=/users/robin/addmrpt_1_11584_11649.txt
  Dec 18 14:50:39 szdb sendEmail[18715]: Email was sent successfully!
  robin@SZDB:~> cat addmrpt_1_11584_11649.txt | sendEmail -f \
  > -t "Robinson cheng <>" \
  > -u "Test mail and the body from file contents"
  Reading message body from STDIN because the '-m' option was not used.
  If you are manually typing in a message:
    - First line must be received within 60 seconds.
    - End manual input with a CTRL-D on its own line.
  Dec 18 14:47:31 szdb sendEmail[18709]: Message input complete.
  Dec 18 14:47:31 szdb sendEmail[18709]: Email was sent successfully!
  robin@SZDB:~> sendEmail -f \
  > -t "Robinson cheng <>" \
  > -u "HTML test mail" \
  > -o message-file=/users/robin/CNMMBO_awrrpt_1_20121218.html
  Dec 18 14:54:07 szdb sendEmail[18721]: Email was sent successfully!
  #Author :Robinson
  #Blog   :
  robin@SZDB:~> sendEmail -f \
  > -t \
  > -u "This is an html test mail" \
  > -o message-content-type=html \
  > -m "The body is html format"
  Dec 18 15:19:36 szdb sendEmail[18883]: Email was sent successfully!