外部郵件發送

                           外部郵件發送配置

1、首先查看服務器上是否安裝好了mailx

rpm-qa mailx

如果沒有安裝那就使用yum直接進行安裝

 

2、如果安裝好了,進入配置文件進行外部郵件配置

vim /etc/mail.rc

進入文件添加:

set [email protected]            #外部郵件地址

setsmtp=smtp.139.com                #外部郵件服務器

[email protected]      #外部郵件用戶

set smtp-auth-password=xxxxxxx    #外部郵件對應的密碼

setsmtp-auth=login                            

外部郵件配置完成

 

3、關閉sendmail服務和postfix服務

service sendmailstop

chkconfig sendmaioff

service postfixstop

chkconfig postfixoff


4、 進行郵件發送測試

可以使用命令測試:

echo "主題"|mail -s"內容" 郵件接收地址

例如:

echo "test"|mail -s "good" [email protected]

查看郵件是否收到並且查看郵件來源地址是否是自己所配置的[email protected]

配置結束


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章