Centos use Mailx send SMTP Mail
Centos use Mailx and third part SMTP server send mail
{ 1. install Mailx }
yum install -y mailx
{ 2. Config SMTP Params}
vi /etc/mail.rc
# Add Gmail SMTP
set from=yiilib.com_t@gmail.com #send from mail address
set smtp=smtp.gmail.com #SMTP server domain
set smtp-auth-user=yiilib.com_t #send account
set smtp-auth-password=mailBoxPassword #account password
set smtp-auth=login #auth way
{ 3. send test }
echo "mail body" | mail boy.lee.here@mail.com -s "test mail subject" -a /root/backup/yiilib.com_tmp.sql
Leave Comment