有些時候server中的一些資訊需要通過郵件來發送,那麼這時候server中又沒有搭建mail 伺服器,可以通過下面的方法來向外網使用者發送郵件。
1、開啟postfix郵件服務
service postfix start
2、設定/etc/mail.rc
3、發送郵件
echo “hello” | mail -a /root/test.txt -s “test mail” [email protected]
4、驗證
發現郵件已經成功收到
![](https://img.laitimes.com/img/_0nNw4CM6IyYiwiM6ICdiwiI4EDN3QDOwQTMwETMxUTMwIzLcRXZu5ibkN3Yuc2bsJmLn1Wavw1LcpDc0RHaiojIsJye.jpg)
有些時候server中的一些資訊需要通過郵件來發送,那麼這時候server中又沒有搭建mail 伺服器,可以通過下面的方法來向外網使用者發送郵件。
1、開啟postfix郵件服務
service postfix start
2、設定/etc/mail.rc
3、發送郵件
echo “hello” | mail -a /root/test.txt -s “test mail” [email protected]
4、驗證
發現郵件已經成功收到