Centos 下mail 命令使用

來源:互聯網
上載者:User

1.mail 基本文法

h|headers 顯示當前的郵件清單
l|list 顯示當前支援的命令列表
?|help 顯示多個查看郵件清單的命令參數用法
d 刪除當前郵件,指標並下移。 d 1-100 刪除第1到100封郵件
t|type|more|p|page num 閱讀某一封郵件
n|next|{什麼都不填} 閱讀當前指標所在的下一封郵件內容;閱讀時,按空格鍵就是翻頁,按斷行符號鍵就是下移一行
n|next|{什麼都不填} num 閱讀某一封郵件
f|from num 查看郵件標頭
top 顯示當前指標所在的郵件的郵件標頭
file|folder 顯示整個使用者郵件存放路徑和郵件個數
mail 寫信郵件 編輯完本文按下Ctrl+D 鍵或. 鍵結束本文
q 退出


2.郵件存放位置:
/var/spool/mail/username


3.三種發送郵件方式:


1.標準輸入錄入郵件內容:
mail -s "title" username@domain.c
按下Ctrl+D 鍵或. 鍵結束本文

2.管道方式
echo “mail content”|mail -s "title" username@domain.c
cat somefile |mail-s "title" username@domain.c

3.檔案重新導向方式
mail -s "title" username@domain.c < file

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.