yum -y update
yum install -y mailx
We can now start sending e-mails using
create a symbolic link
ln -s /bin/mailx /bin/email
###Set an External SMTP Server to Relay E-Mails
vi /etc/mail.rc
edit
set smtp=smtps://smtp.gmail.com:465
set smtp-auth=login
set smtp-auth-user=USERNAME@YOURDOMAIN.COM
set smtp-auth-password=YOURPASSWORD
set ssl-verify=ignore
set nss-config-dir=/etc/pki/nssdb/
send email
example usage :
echo "Your message" | mail -v -s "Message Subject" email@address
本文出自 “实践出真知” 博客,请务必保留此出处http://m51cto.blog.51cto.com/53087/1961340
原文地址:http://m51cto.blog.51cto.com/53087/1961340