53g
[root@localhost ~]# rpm ‐q sendmail mailx
sendmail‐8.14.4‐8.el6.x86_64
mailx‐12.4‐7.el6.x86_64

修改 /etc/mail.rc 配置文件,添加下面两行。
[root@localhost ~]# vim /etc/mail.rc
set from=123@163.com smtp=smtp.163.com
set smtp‐auth‐user=123 smtp‐auth‐password=1234455 smtp‐auth=login
set content‐type=html
set encoding=GB2312

解释一下配置文件内容
from 发送邮件的地址
smtp 发生的外部的smtp服务器的地址
smtp‐auth‐user 外部smtp服务器认证的用户名
smtp‐auth‐password 外部smtp服务器认证的用户密码
smtp‐auth是邮件认证的方式
content‐type=html 发送形式
encoding=GB2312 发送内容字符编码

测试
[root@localhost ~]# mail ‐s "test" 123@qq.com < /etc/issue

1 对 “sendmail向外网发送邮件”的想法;

回复 Nova 取消回复

您的电子邮箱地址不会被公开。 必填项已用*标注

Captcha Code