[原]Linux 命令行 发送邮件

时间:2023-03-09 17:24:58
[原]Linux 命令行 发送邮件

1、mail -s
hi xx@yy.com

给xx@yy.com发一封主题为hi的信(没有正文)

编辑完内容后Ctrl-D结束。

2、echo “This is a test mail!”|mail -s
hi xx@yy.com

给xx@yy.com发一封主题为hi的信(正文是This is a test mail!)

3、mail -s hi
xx@yy.com < file

      以file的内容为邮件内容发信,首先选择事先写好一个文档然后再mail过去。

4、带附件的邮件发送

      4.1 如果你的系统中没有uuencode命令的话,则需要先安装sharutils(sudo apt-get install sharutils)

4.2 uuencode myfile myfile|mail -s hi  xx@yy.com

其中myfile就是要添加的附件

作者:EXLsunshine 发表于2014-8-17 15:22:51 原文链接
阅读:46 评论:0 查看评论