补充说明
语法
mail(选项)(参数)选项
-b<地址>:指定密件副本的收信人地址;
-c<地址>:指定副本的收信人地址;
-f<邮件文件>:读取指定邮件文件中的邮件;
-i:不显示终端发出的信息;
-I:使用互动模式;
-n:程序使用时,不使用mail.rc文件中的设置;
-N:阅读邮件时,不显示邮件的标题;
-s<邮件主题>:指定邮件的主题;
-u<用户帐号>:读取指定用户的邮件;
-v:执行时,显示详细的信息。参数
实例
Last updated
mail(选项)(参数)-b<地址>:指定密件副本的收信人地址;
-c<地址>:指定副本的收信人地址;
-f<邮件文件>:读取指定邮件文件中的邮件;
-i:不显示终端发出的信息;
-I:使用互动模式;
-n:程序使用时,不使用mail.rc文件中的设置;
-N:阅读邮件时,不显示邮件的标题;
-s<邮件主题>:指定邮件的主题;
-u<用户帐号>:读取指定用户的邮件;
-v:执行时,显示详细的信息。Last updated
mail -s "Hello from jsdig.com by shell" admin@jsdig.com
hello,this is the content of mail.
welcome to www.jsdig.comecho "hello,this is the content of mail.welcome to www.jsdig.com" | mail -s "Hello from jsdig.com by pipe" admin@jsdig.commail -s "Hello from jsdig.com by file" admin@jsdig.com < mail.txtmail -s "Hello from jsdig.com with sender" admin@jsdig.com -- -f user@jsdig.com<mail.txtyum install sharutilsuuencode test.txt test | mail -s "hello,see the attachement" admin@jsdig.com<mail.txt