1.安装mail了mutt
yum -y install mailx
yum -y install mutt
2.修改/etc/mail.rc
在末尾添加以下信息:
set from=username@163.com#可以不写
set smtp=smtp.joyveb.com
set smtp-auth=login
set smtp-auth-user=user
set smtp-auth-password=password
- 测试:
echo "test1234" | mail -s "test" username@joyveb.com
转载于:https://blog.51cto.com/1054054/2096410