linux 發送郵件,其實是linux 系統 使用你配置的郵箱 的用戶名和密碼 來登錄你的郵箱
使用此郵箱來發送郵件
1、關閉服務
service sendmail stop
chkconfig sendmail off
2、修改參數配置
vi /etc/postfix/main.cf
inet_interfaces = all
3、.啓動postfix服務:
service postfix start
chkconfig postfix on
postfix check
systemctl status postfix
4、
$ vi /etc/mail.rc
set [email protected]
set smtp=smtp.qq.com
set smtp-auth-user=123456
set smtp-auth-password=runoob
set smtp-auth=login
參數解釋:
set from= 你的qq郵箱
set smtp-auth-user= 你的qq郵箱的登錄名
set smtp-auth-password= 你的qq郵箱的獲取的授權碼
獲取的授權碼 獲取方式
第一步進入qq郵箱
第二步
第三步生成授權碼
測試
爲126 郵箱發送消息