sendmail函數(shù)與mail函數(shù)怎么在Linux中使用?針對這個問題,這篇文章詳細介紹了相對應(yīng)的分析和解答,希望可以幫助更多想解決這個問題的小伙伴找到更簡單易行的方法。
創(chuàng)新互聯(lián)專注于企業(yè)營銷型網(wǎng)站、網(wǎng)站重做改版、鹽山網(wǎng)站定制設(shè)計、自適應(yīng)品牌網(wǎng)站建設(shè)、成都h5網(wǎng)站建設(shè)、購物商城網(wǎng)站建設(shè)、集團公司官網(wǎng)建設(shè)、成都外貿(mào)網(wǎng)站制作、高端網(wǎng)站制作、響應(yīng)式網(wǎng)頁設(shè)計等建站業(yè)務(wù),價格優(yōu)惠性價比高,為鹽山等各大城市提供網(wǎng)站開發(fā)制作服務(wù)。
環(huán)境
本機安裝sendmail了, 但是沒有啟動。 其他機器上有mail server, 并且已經(jīng)把本機加到open relay列表中了, 可以通過該mail server發(fā)送郵件。
代碼如下
#tar –zxvf sendEmail-v1.56.tar.gz
#cd sendEmail-v1.56
#cp sendEmail /usr/local/bin
然后給確認確實它具有執(zhí)行權(quán)限
代碼如下
ll /usr/local/bin/sendEmail
-rwxr-xr-x 1 root root 77882 11-03 14:23 /usr/local/bin/sendEmail
做法如下:
1. 安裝 sendmail-cf 軟件包
2. 修改 /etc/mail/submit.mc
1 FEATURE(`msp‘’, `[127.0.0.1]‘’)dnl
2 修改為
3 FEATURE(`msp‘’, `[Your mail server ip]‘’)dnl
3. 在 /etc/mail/ 目錄下執(zhí)行 make
測試
代碼如下
mail -s ‘’hello www.xitongzhijia.net world!‘’ user1@chxbd.com
bin/mail會默認使用本地sendmail發(fā)送郵件,這樣要求本地的機器必須安裝和啟動Sendmail服務(wù),配置非常麻煩,而且會帶來不必要的資源占用。
如果你不用了我們可以關(guān)閉sendmail
關(guān)閉sendmail服務(wù)
代碼如下
a.[root@sample ~]# /etc/rc.d/init.d/sendmail stop ← 關(guān)閉sendmail服務(wù)
或者[root@sample ~]# service sendmail stop ← 關(guān)閉sendmail服務(wù)
Shutting down sendmail: [ OK ]
Shutting down sm-client: [ OK ]
b.[root@sample ~]# chkconfig sendmail off ← 關(guān)閉sendmail自啟動
c.[root@sample ~]# chkconfig --list sendmail ← 確認sendmail自啟動已被關(guān)閉(都為off就OK)
sendmail 0:off 1:off 2:off 3:off 4:off 5:off 6:off
關(guān)于sendmail函數(shù)與mail函數(shù)怎么在Linux中使用問題的解答就分享到這里了,希望以上內(nèi)容可以對大家有一定的幫助,如果你還有很多疑惑沒有解開,可以關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道了解更多相關(guān)知識。
新聞標題:sendmail函數(shù)與mail函數(shù)怎么在Linux中使用
文章轉(zhuǎn)載:http://aaarwkj.com/article24/igdoje.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供靜態(tài)網(wǎng)站、網(wǎng)站設(shè)計、ChatGPT、網(wǎng)站內(nèi)鏈、Google、小程序開發(fā)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)