Mailx – The mail utilities listed above provide a comfortable, flexible environment for sending and receiving mail messages electronically.
1.升级yum并安装Mailx程序
yum update -y yum install -y mailx
3.设置外部 SMTP 服务器中继电子邮件(配置mail.rc)
vi /etc/mail.rc
# Add QQ SMTP
set from=send_account\@qq.com #send from mail address
set smtp=smtp.qq.com:465 #SMTP server domain
set smtp-auth-user=send_account@qq.com #send account
set smtp-auth-password=account_password #account password
set smtp-auth=login #auth way
set nss-config-dir=/etc/pki/nssdb/
发送测试邮件
echo "Hello Mail Content" | mail -v -s "Message Subject" send_account@qq.com
发表回复