Installing mailx
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:465set smtp-auth=loginset [email protected]set smtp-auth-password=YOURPASSWORDset ssl-verify=ignoreset nss-config-dir=/etc/pki/nssdb/
send email
example usage :
echo "Your message" | mail -v -s "Message Subject" [email protected]
时间: 2024-10-09 19:58:25