常用shell命令 - mail

1
2
[root@localhost ~]# mail -s "test mail" root </root/ anaconda-ks.cfg
#把/root/anaconda-ks.cfg文件的内容发送给root用户
1
2
3
4
5
6
7
8
9
10
11
12
-f 表示发送者的邮箱
-t 表示接收者的邮箱
-cc 表示抄送发给谁
-bcc 表示暗抄送给谁
-o message-content-type=html 邮件内容的格式,html表示它是html格式
-o message-charset=utf8 邮件内容编码
-s 表示SMTP服务器的域名或者ip
-u 表示邮件的主题
-xu 表示SMTP验证的用户名
-xp 表示SMTP验证的密码(注意,这个密码貌似有限制,例如我用d!5neyland就不能被正确识别)
-m 邮件的内容
-a 要发送的附件
-------------本文结束感谢您的阅读-------------