10/12/13

linux下通过外部smtp发送邮件

1、去掉sendmail postfix

#sendmial service sendmail stop

chkconfig sendmail off

#postfix service postfix stop

chkconfig postfix off

#直接卸载

yum remove sendmail

yum remove postfix

2、修改/etc/mail.rc 添加如下smtp服务器地址,帐号密码等

vi /etc/mail.rc

set from=xxx@163.com

set smtp=smtp.163.com

set smtp-auth-user=xxx

set smtp-auth-password=pass

set smtp-auth=login

3、测试邮件发送

echo “email content”|mail -s “email title” 123456@qq.com