l 4000 inux下命令行 mail 发邮件方法
2016-02-22 12:05
351 查看
Linux 下
命令行 mail 发邮件方法
1. 最简单的方法:
mail -s text **@mail.ustc.edu.cn
这条命令的结果是发一封标题为text的空信给后面的邮箱,但是往往这类邮件会被当成垃圾邮件来处理,
所以如果没有收到邮件,建议打开垃圾箱来查看一下.第一种方法,你可以把当前shell当成编辑器来用,
编辑完内容后Ctrl-D结束。
2,实用的mail发送方法。
#第二种方法,使用管道命令
echo “This is a test mail!”|mail -s text**@mail.ustc.edu.cn
#第三种方法,使用重定向。
mail -s test **@mail.ustc.edu.cn <file
以file的内容为邮件内容发信,首先选择事先写好一个文档然后再mail过去。
3. 带附件的邮件发送(重点)
如果你的系统中没有uuencode命令的话,则需要先安装sharutils,
sudo apt-get install sharutils。
uuencode 需要两个参数,第一个是你要发送的文件,当然这个也可以用管道来做,第二个是显示的文件名
uuencode /home/daniel/httpd.confhttpd.conf|mail -s mailtest **@mail.ustc.edu.cn
命令行 mail 发邮件方法
[日期:2013-07-21] | 来源:Linux社区 作者:gfsfg8545 | [字体:大 中 小] |
mail -s text **@mail.ustc.edu.cn
这条命令的结果是发一封标题为text的空信给后面的邮箱,但是往往这类邮件会被当成垃圾邮件来处理,
所以如果没有收到邮件,建议打开垃圾箱来查看一下.第一种方法,你可以把当前shell当成编辑器来用,
编辑完内容后Ctrl-D结束。
2,实用的mail发送方法。
#第二种方法,使用管道命令
echo “This is a test mail!”|mail -s text**@mail.ustc.edu.cn
#第三种方法,使用重定向。
mail -s test **@mail.ustc.edu.cn <file
以file的内容为邮件内容发信,首先选择事先写好一个文档然后再mail过去。
3. 带附件的邮件发送(重点)
如果你的系统中没有uuencode命令的话,则需要先安装sharutils,
sudo apt-get install sharutils。
uuencode 需要两个参数,第一个是你要发送的文件,当然这个也可以用管道来做,第二个是显示的文件名
uuencode /home/daniel/httpd.confhttpd.conf|mail -s mailtest **@mail.ustc.edu.cn
相关文章推荐
- AIDL的全称是什么?如何工作?
- [NSBundle mainBundle] 详解
- Unix Study之--AIX系统构建RAC通过ASM磁盘共享
- Unix Study之--AIX系统构建RAC通过ASM磁盘共享
- hadoop环境报failed on connection exception
- 关于https的Error:Error Domain=NSURLErrorDomain Code=-1012
- 【Winform】 无法将类型为“System.Windows.Forms.SplitContainer”的对象强制转换为类型“System.ComponentModel.ISupportInitialize”。
- 《Batch Normalization Accelerating Deep Network Training by Reducing Internal Covariate Shift》阅读笔记与实现
- caffe: train error: Serializing 25 layers--- Check failed: proto.SerializeToOstream(&output)
- 使用canvas与Paint在View中居中绘制文字
- Atitit.5gl 第五代语言编程语言 PROLOG教程 人工智能语言的标准 与实现
- Atitit.5gl 第五代语言编程语言 PROLOG教程 人工智能语言的标准 与实现
- Atitit.5gl 第五代语言编程语言 PROLOG教程 人工智能语言的标准 与实现
- background-size: contain 与cover的区别,以及ie78的兼容写法
- rails生产环境 secret_key_base问题
- Platforms/iPhoneSimulator.platform/Developer/usr/bin/g++-4.2 failed with exit code 1问题总结及解决方案
- ADG switchover and failover 、三种模式的切换
- golang--sync.WaitGroup使用示例
- find . -name file -exec echo abc > {} \; fail
- ICPCCamp 2016 Day1 ftiasch's Contest #4(All Pair Shortest Path-位运算)