不可或缺的 sendEmail

    还在为Linux下没有便捷的邮件程序苦恼,还在为复杂的邮件服务器架设Google N多网页? 对于小型,便捷的Linux下命令行邮件程序,sendEmail使得这一切变得轻松可行。一起来看看吧。

一、sendEmail介绍
   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简单,轻量级,命令行,可伸缩,跨平台。

二、下载与安装
  下面的地址是sendEmail的下载及详细说明
  http://caspian.dotconf.net/menu/Software/SendEmail/

  下面是安装描述,总共四个步骤就搞定。
  ------------------
  Installation
  ------------------
  
  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
      sendEmail
        or
      /usr/local/bin/sendEmail

三、用法    
  直接输入sendEmail,将出现该工具的用法介绍,如下所示。由于用法也简单明了,因此不一一解释
  robin@SZDB:~/dba_scripts/sendEmail-v1.56> ./sendEmail
  
  sendEmail-1.56 by Brandon Zehm <caspian@dotconf.net>
  
  Synopsis:  sendEmail -f ADDRESS [options]
  
    Required:
      -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
  
    Common:
      -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
  
    Optional:
      -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
  
    Paranormal:
      -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:
      --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 robinson@oracle.com \
  > -t robinson.cheng@trade.com \
  > -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 rocket010824@163.com \
  > -t robinson.cheng@trade.com \
  > -u "Test Mail" \
  > -s smtp.163.com \
  > -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 robinson@oracle.com \                                                                   
  > -t "Robinson cheng <robinson.cheng@trade.com>" jackson@163.com \
  > -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 robinson@oracle.com \
  > -t "Robinson cheng <robinson.cheng@trade.com>" \
  > -cc jason.wu@trade.com \
  > -bcc jackson@163.com \
  > -u "Test mail " \
  > -m "This is a test mail"
  
  发送带有附件的邮件
  robin@SZDB:~> sendEmail -f robinson@oracle.com \
  > -t "Robinson cheng <robinson.cheng@trade.com>" \
  > -cc jason.wu@trade.com \
  > -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!
  
  #使用文件内容作为邮件的body
  robin@SZDB:~> sendEmail -f robinson@oracle.com \
  > -t "Robinson cheng <robinson.cheng@trade.com>" \
  > -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 robinson@oracle.com \
  > -t "Robinson cheng <robinson.cheng@trade.com>" \
  > -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!
  
  #发送邮件时读取html文件内容作为body
  robin@SZDB:~> sendEmail -f robinson@oracle.com \
  > -t "Robinson cheng <robinson.cheng@trade.com>" \
  > -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   : http://blog.csdn.net/robinson_0612
 
  #发送html邮件 
  robin@SZDB:~> sendEmail -f robinson@oracle.com \
  > -t robinson.cheng@trade.com \
  > -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! 


更多参考

有关Oracle RAC请参考
     使用crs_setperm修改RAC资源的所有者及权限
     使用crs_profile管理RAC资源配置文件
     RAC 数据库的启动与关闭
     再说 Oracle RAC services
     Services in Oracle Database 10g
     Migrate datbase from single instance to Oracle RAC
     Oracle RAC 连接到指定实例
     Oracle RAC 负载均衡测试(结合服务器端与客户端)
     Oracle RAC 服务器端连接负载均衡(Load Balance)
     Oracle RAC 客户端连接负载均衡(Load Balance)
     ORACLE RAC 下非缺省端口监听配置(listener.ora tnsnames.ora)
     ORACLE RAC 监听配置 (listener.ora tnsnames.ora)
     配置 RAC 负载均衡与故障转移
     CRS-1006 , CRS-0215 故障一例 
     基于Linux (RHEL 5.5) 安装Oracle 10g RAC
     使用 runcluvfy 校验Oracle RAC安装环境

有关Oracle 网络配置相关基础以及概念性的问题请参考:
     配置非默认端口的动态服务注册
     配置sqlnet.ora限制IP访问Oracle
     Oracle 监听器日志配置与管理
     设置 Oracle 监听器密码(LISTENER)
     配置ORACLE 客户端连接到数据库

有关基于用户管理的备份和备份恢复的概念请参考
     Oracle 冷备份
     Oracle 热备份
     Oracle 备份恢复概念
     Oracle 实例恢复
     Oracle 基于用户管理恢复的处理
     SYSTEM 表空间管理及备份恢复
     SYSAUX表空间管理及恢复
     Oracle 基于备份控制文件的恢复(unsing backup controlfile)

有关RMAN的备份恢复与管理请参考
     RMAN 概述及其体系结构
     RMAN 配置、监控与管理
     RMAN 备份详解
     RMAN 还原与恢复
     RMAN catalog 的创建和使用
     基于catalog 创建RMAN存储脚本
     基于catalog 的RMAN 备份与恢复
     RMAN 备份路径困惑
     使用RMAN实现异机备份恢复(WIN平台)
     使用RMAN迁移文件系统数据库到ASM
     linux 下RMAN备份shell脚本
     使用RMAN迁移数据库到异机

有关ORACLE体系结构请参考
     Oracle 表空间与数据文件
     Oracle 密码文件
     Oracle 参数文件
     Oracle 联机重做日志文件(ONLINE LOG FILE)
     Oracle 控制文件(CONTROLFILE)
     Oracle 归档日志
     Oracle 回滚(ROLLBACK)和撤销(UNDO)
     Oracle 数据库实例启动关闭过程
     Oracle 10g SGA 的自动化管理
     Oracle 实例和Oracle数据库(Oracle体系结构) 

评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

清风智语

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值