不可或缺的 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!
- 转:http://blog.csdn.net/leshami/article/details/8314570
不可或缺的 sendEmail的更多相关文章
- Linux/Unix shell 监控Oracle实例(monitor instance)
使用shell脚本实现对Oracle数据库的监控与管理将大大简化DBA的工作负担,如常见的对实例的监控,监听的监控,告警日志的监控,以及数据库的备份,AWR report的自动邮件等.本文给出Linu ...
- Linux/Unix shell 监控Oracle监听器(monitor listener)
使用shell脚本实现对Oracle数据库的监控与管理将大大简化DBA的工作负担,如常见的对实例的监控,监听的监控,告警日志的监控,以及数据库的备份,AWR report的自动邮件等.本文给出Linu ...
- Linux/Unix shell 监控Oracle告警日志(monitor alter log file)
使用shell脚本实现对Oracle数据库的监控与管理将大大简化DBA的工作负担,如常见的对实例的监控,监听的监控,告警日志的监控,以及数据库的备份,AWR report的自动邮件等.本文给出Linu ...
- Linux/Unix shell 自动发送AWR report(二)
观察Oracle数据库性能,Oracle自带的awr 功能为我们提供了一个近乎完美的解决方案,通过awr特性我们可以随时从数据库提取awr报告.不过awrrpt.sql脚本执行时需要我们提供一些交互信 ...
- PL/SQL 下邮件发送程序
对DBA而言,尽管在os级别下发送邮件是轻而易举的事情,然而很多时候我们也需要在PL/SQL中来发送邮件,比如监控job的执行状况等.本文根据网友(源作者未考证)的代码将其改装并封装到了package ...
- 用 shell 脚本做 restful api 接口监控
问题的提出 基于历史原因,公司有一个"三无"采集服务--无人员.无运维.无监控--有能力做的部门不想接.接了的部门没能力.于是就一直这样裸奔,直到前几天一个依赖于这个采集服务的大数 ...
- sendEmail
原文:http://blog.chinaunix.net/uid-16844903-id-308853.html 功能: 发邮件的客户端 官网地址: http://caspian.dotconf.ne ...
- zabbix告警使用sendEmail
1sendmail介绍 详细介绍见官网:http://caspian.dotconf.net/menu/Software/SendEmail/ 2使用sendEmail sendEmail是个十分优秀 ...
- sendEmail报错:at /usr/share/perl5/vendor_perl/IO/Socket/SSL.pm
sendEmail发送邮件是出现以下报错: ******************************************************************* Using the ...
随机推荐
- Node.js缓冲模块Buffer
前言 Javascript是为浏览器而设计的,能很好的处理unicode编码的字符串,但对于二进制或非unicode编码的数据就显得无能为力. Node.js继承Javascript的语言特性,同时又 ...
- JDK安装(windows/linux)
双击安装...安装之后需要进行一些相关的配置工作...下面是我自己总结的安装和配置步骤: (1)非Win7系统 第一步:安装jdk,下载地址:http://www.oracle.com/technet ...
- iOS 应用内付费(IAP)开发步骤
折腾好几天,原来是税务信息没有填写,哎... 国内就是好啊,没有这些麻烦的事情... :) 等24小时,等税务的审核结果... 有结论了 才能测试内购.... 如果税务信息没有填写完毕,p ...
- jquery plug-in DataTable API中文文档参考
前言:最近在做一个WEB后台,无意中发现这个插件,试用了一下觉得不错,但网上关于它的资料大多不全,所以利用一些时间将其API文档翻了一下,发在园子里供大家参考.(p.s:个人E文水平很差,对着灵格斯翻 ...
- Java的Reference感觉很象C++的指针,但是区别是本质的
Java的Reference感觉很象C++的指针,但是区别是本质的 他们相同之处在于都是含有一个地址,但是在Java中你无法对这个地址进行任何数学运算,并且这个地址你不知道,是Java Runtime ...
- 虚拟机WindowServer2003共享文件夹
前话 之前我写过虚拟机装SQL Server的博文,也许有同学参考了也通过虚拟机装数据库服务来做实验作业了. 到了第二章节学习时,实验要求数据库导出Excel文件,这样一来就出现了小问题了,Windo ...
- iOS:CALayer核心动画层上绘图
在CALayer上绘图: •要在CALayer上绘图,有两种方法: 1.创建一个CALayer的子类,然后覆盖drawInContext:方法,可以使用Quartz2D API在其中进行绘图 2.设置 ...
- poj 1180 斜率优化dp
这个题目要是顺着dp的话很难做,但是倒着推就很容易退出比较简单的关系式了. dp[i]=min(dp[u]+(sum[u-1]-sum[i-1]+s)*f[i]);dp[i]代表从i到结尾需要花费的代 ...
- SQL高性能查询优化语句
1.应尽量避免在 where 子句中对字段进行 null 值判断,否则将导致引擎放弃使用索引而进行全表扫描,如: select id from t where num is null可以在num上设置 ...
- Android 判断用户2G/3G/4G移动数据网络
Android 判断用户2G/3G/4G移动数据网络 在做 Android App 的时候,为了给用户省流量,为了不激起用户的愤怒,为了更好的用户体验,是需要根据用户当前网络情况来做一些调整的,也可以 ...