centos 使用mail傳送郵件

2021-10-06 23:34:36 字數 584 閱讀 9962

1.確認是否安裝:一般是預設安裝

#which mail

如未安裝,#yum install sendmail mailx -y (mail預設依賴sendmail傳送郵件)

2.申請乙個郵箱,登入郵箱後設定成pop3,smtp可用

3.回到伺服器上,設定郵箱配置:/etc/mai.rc

4.在配置的最後兩行新增如下:

set [email protected] smtp=smtp.ym.163.com

set [email protected] smtp-auth-password=353711 smtp-auth-login

5.測試:

#echo test |mail -s test [email protected]

6.傳送附件

echo test |mail -s test -a /var/log/nginx/access.log [email protected] -c [email protected]

mail –help:

-s 主題

-a 附件

-c 抄送

centos 使用 mail 傳送郵件

這是在解決mysql自動備份的時候需要做的,單獨拿出來記錄一下 首先163開通smtp pop3並開通設定授權碼 centos主機上,執行如下命令安裝sendmail。yum y install sendmail systemctl start sendmail yum install y mail...

wamp下使用php的mail 函式傳送郵件問題

環境搭建 除了配置wamp之外,還需要乙個郵件伺服器,使用sendmail smtp server smtp.qq.com 可以用gmail 163 qq auto use ssl for port 465,otherwise try to use tls 配置smtp server埠使用ssl s...

Centos7下使用mail傳送郵件

centos7下使用mail傳送郵件 root proxyserver rpm qa grep mail libreport plugin mailx 2.0.9 19.el6.x86 64 mailx 12.4 7.el6.x86 64 procmail 3.22 25.1.el6.x86 64 ...