sendmail如何设置第三方服务器发邮件
- yum install sendmail
2、停止postfix邮件服务,(系统默认打开,占用25端口)
#service postfix stop
3.修改配置文件,添加5行 set 有关内容
#vim
/etc/mail
.rc
# Outgoing messages are sent in ISO-8859-1 if all their characters are # representable in it, otherwise in UTF-8. set sendcharsets=iso-8859-1,utf-8 set [email protected] set smtp=smtp.qq.com:25 set [email protected] set smtp-auth-password=xxx
4、启动sendmail服务
# service sendmail restart
5. 测试
#echo test | mail -s aaa [email protected]
格式说明:
语法:echo ‘内容‘ | mail -s “主题”用户名@地址
例如:
echo “text” | mail -s “program” user
6、登陆收件箱
时间: 2024-10-19 19:46:50