sendmail如何设置第三方服务器发邮件
yum install sendmail
2.修改配置文件,添加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 from=xxxxguard@126.com set smtp=smtp://smtp.126.com:25 set smtp-auth-user=xxxxguard@126.com set smtp-auth-password=xxxxxxxx
3. 测试
echo test | mail -s aaa xxx@163.com
mail 具体用法,参考help
4.关于sendmail启动慢的问题
修改自己hostname为 client.example.com 这样的格式,
同时 /etc/hosts 也要添加。注意只能用这样的格式。
我自己的:
[root@client1 ~]# hostname client1.example.com [root@client1 ~]# cat /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 127.0.0.1 client1.example.com
本文出自 “wolf_ribble@163.com” 博客,转载请与作者联系!
原文地址:http://ribble.blog.51cto.com/3863110/1649554