6. 测试
-
# yum -y install mailx
-
# date | mail -r no-reply@flying.com -s 'exim test' uttflying@foxmail.com
-
# tail -f /var/log/exim/main.log #exim日志文件
ps:
如果不指定-r(发邮件地址),且你的主机名不是xxx.com,可能会报如下错误:
SMTP error from remote mail server after MAIL FROM:
错误是550 MI:IMF 发信人电子邮件地址不合规范
使用文件进行邮件发送:
date | mail -r flying@yflying.com -s 'SN_IP info TEXT ' uttflying@163.com wanglei@flying.com < /root/cobbler/sn.log
mail命令的语法如下:
Usage: mail [-iInv] [-s subject] [-c cc-addr] [-b bcc-addr] to-addr ...
[-- sendmail-options ...]
mail [-iInNv] -f [name]
mail [-iInNv] [-u user]
测试成功