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 [email protected]
set smtp-auth-password=YOURPASSWORD
set ssl-verify=ignore
set nss-config-dir=/etc/pki/nssdb/
example usage :
echo "Your message" | mail -v -s "Message Subject" email@address
Getting below error -
Resolving host smtp.gmail.com . . . done.
Connecting to 74.125.24.109:465 . . .Connecting to 74.125.24.108:465 . . .Connecting to 2404:6800:4003:c03::6c:465 . . .could not connect: Network is unreachable
"/root/dead.letter" 10/253
Please help