首先介绍下sendMail

About 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.
[Supported Platforms: Linux, BSD, OS X, Windows 98, Windows NT, Windows 2000, & Windows XP]

http://caspian.dotconf.net/menu/Software/SendEmail/

下载解压后就能使用命令行工具了。或者:

安装方法:
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

部分参数如下:
-f 表示from,发件人地址
-t 表示to,收件人地址
-s mail服务器域名
-u 主题
-xu 用户名(@之前的)
-xp 用户密码
-m 纯文本信息
-o message-file=/root/.. 发送文件中的内容
-a 发送附件 (-m,-o,-a可以同时使用)
例如:
[root@blog sendEmail-v1.56]# ./sendEmail -f aaaa@163.com -t bbbb@163.com -s smtp.163.com -xu aaaa -xp password -u test -m testeamil
Apr 10 10:09:16 blog sendEmail[8861]: Email was sent successfully!
问题:
1·如果出现如下提示
Jan 30 10:06:15 ora01 sendEmail[8704]: ERROR => Connection attempt to localhost:25 failed: IO::Socket::INET: connect: Connection refused
是没有指定-s参数,邮件服务器域名。

shell脚本监测:

http://blog.chinaunix.net/uid-7589639-id-3018209.html

大多数邮件服务都有短信通知服务,比如sina的就有每个月50条免费短信用,对于个人来说,够用了。

最新文章

  1. bzoj1500
  2. 一道javascript数组操作题
  3. AOP学习心得&jdk动态代理与cglib比较
  4. python基础知识---操作文件
  5. dedecms最新版本修改任意管理员漏洞+getshell+exp
  6. AMD GPU spec (public)
  7. javascript 金额格式化
  8. Linux之磁盘管理
  9. HDU 4288 Coder 【线段树+离线处理+离散化】
  10. 定时关机命令-shutdown
  11. JAVA Socket连接服务器时可能抛出的异常
  12. Java爬虫——B站弹幕爬取
  13. c#+Unity3D
  14. Java中的super()使用注意
  15. vue--vConsole
  16. receiving error: 'Error: SSL Error: SELF_SIGNED_CERT_IN_CHAIN' while using npm
  17. MyCat不支持的SQL语句
  18. 7 款顶级的开源 Web 分析软件
  19. Linux中Kill掉进程的10种方法
  20. iOS 界面启动时,功能新特征显示

热门文章

  1. hdu6078 Wavel Sequence dp+二维树状数组
  2. C语言 百炼成钢25
  3. 深入了解Go Playground
  4. ajax 跨域 4种方法
  5. java锁和同步
  6. 振铃效应(ringing artifacts)
  7. Laravel5.1 模型 --多态关联
  8. DICOM:docker实现DICOM服务虚拟化
  9. python数据类型及运算符
  10. SQL Server快捷方式丢了怎么启动