<code id="ymukc"><xmp id="ymukc">

Linux 下 命令行 mail 發郵件方法

ScaNIV的頭像 ScaNIV 0 2016-03-04 15:03 5

 基本信息

× 1   

瀏覽數: 36635

分享時間: 2 年 前

2

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.conf httpd.conf|mail -s mailtest  **@mail.ustc.edu.cn


發送郵件帶內容附件

echo "tt"|mail -a /home/pengzz/checknginx.sh -s "test" [email protected]

發送郵件帶內容附件,使用mutt

sudo yum install mutt

echo "hello"|mutt -a /home/pengzz/checknginx.sh -s "subject of " -- [email protected]




12 [下一頁]

  • ossaa的頭像 ossaa 2018-05-09 22:53 代碼數:0

    This is such a great resource that you are providing and you give it away for free. I love seeing websites that understand the value of providing a quality resource for free. It is the old what goes around comes around routine.

    small business ideas in india

  • cixexey的頭像 cixexey 2018-05-21 17:42 代碼數:0

    This blog is so nice to me. I will keep on coming here again and again. Visit my link as well..

    Colorado SEO services

  • cixexey的頭像 cixexey 2018-05-22 18:21 代碼數:0

    I am very happy to discover your post as it will become on top in my collection of favorite blogs to visit.water slide rentals Cincinnati

  • cixexey的頭像 cixexey 2018-05-23 18:50 代碼數:0

    Best work you have done, this online website is really cool with great facts.

    moving companies

  • cixexey的頭像 cixexey 2018-05-23 20:08 代碼數:0

    This is just the information I am finding everywhere. Thanks for your blog, I just subscribe your blog. This is a nice blog..Woodworking Sanders

  • cixexey的頭像 cixexey 2018-05-26 22:57 代碼數:0

    I have read your article, it is very informative and helpful for me.I admire the valuable information you offer in your articles. Thanks for posting it..invisalign near me

  • gererik的頭像 gererik 2018-04-17 15:45 代碼數:0

    Good article, but it would be better if in future you can share more about this subject. Keep posting. www.delphinehubert.com

  • cixexey的頭像 cixexey 2018-05-26 23:00 代碼數:0

    I have read your article, it is very informative and helpful for me.I admire the valuable information you offer in your articles. Thanks for posting it..invisalign near me

  • gererik的頭像 gererik 2018-04-17 18:51 代碼數:0

    This is my first time i visit here. I found so many interesting stuff in your blog especially its discussion. From the tons of comments on your articles, I guess I am not the only one having all the enjoyment here! keep up the good work  www.sampostroi.com

  • sunriders的頭像 sunriders 2016-09-01 22:23 代碼數:0
您的評論:

  
六合特码资料
<code id="ymukc"><xmp id="ymukc">
<code id="ymukc"><xmp id="ymukc">