-
yum install ssmtp
-
vim /etc/ssmtp/ssmtp.conf
root=username@gmail.com
mailhub=smtp.gmail.com:587
RewriteDomain=
Hostname=username@gmail.com
UseSTARTTLS=yes
AuthUser=username@gmail.com
AuthPass=password
FromLineOverride=YES
TLS_CA_File=/etc/pki/tls/certs/ca-bundle.crt -
alternatives –config mta
選擇 /usr/sbin/sendmail.ssmtp -
檢查目前sendmail方式
sendmail -V
sSMTP 2.61 (Not sendmail at all) -
測試
echo “This is a test” | mail -s “Test” cowman.chiang@gmail.com
Reference
1. After updating sSMTP to version 2.61 I cannot send mail via gmail
2. How To Setup sSMTP on CentOS 5.9