1. 检查是否安装了sendmail
rpm -qa | grep sendmail
2. 安装sendmail
yum install -y sendmail
yum install -y sendmail-cf
3.配置外部的smpt服务
set from=fromUser@domain.com smtp=smtp.domain.comset smtp-auth-user=username smtp-auth-passsword=passwordset smtp-auth=login
echo 'hello!' | sendmail -s "hello test" username@qq.com
rpm -qa | grep sendmail
2. 安装sendmail
yum install -y sendmail
yum install -y sendmail-cf
3.配置外部的smpt服务
set from=fromUser@domain.com smtp=smtp.domain.comset smtp-auth-user=username smtp-auth-passsword=passwordset smtp-auth=login
说明:
from是发送的邮件地址
smtp是发生的外部smtp服务器的地址
smtp-auth-user是外部smtp服务器认证的用户名
smtp-auth-password是外部smtp服务器认证的用户密码
smtp-auth是邮件认证的方式
4.测试发送邮件echo 'hello!' | sendmail -s "hello test" username@qq.com
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/28282660/viewspace-1768313/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/28282660/viewspace-1768313/