Skip to content

Instantly share code, notes, and snippets.

@kingoamino
Created August 12, 2020 12:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kingoamino/7c2dfd8123b5cf4ef84057eed6e418fb to your computer and use it in GitHub Desktop.
Save kingoamino/7c2dfd8123b5cf4ef84057eed6e418fb to your computer and use it in GitHub Desktop.
Send mail centos whith mailx
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: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/
example usage :
echo "Your message" | mail -v -s "Message Subject" email@address
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment