# yum install mailx -y # vim /etc/mail.rc set from=hyjy2504164765@163.com smtp=smtp.163.com set smtp-auth-user=hyjy2504164765@163.com smtp-auth-password=pw123456 set smtp-auth=login # 测试,163邮箱服务器需要开启 pop3 smtp 服务,并客户端授权密码 # echo "this is test mail." | mail -s "monitor test" 2504164765@qq.com