在Linux中,邮件服务是必不可少的一项,但是配置邮件相关的基础服务是很多新手朋友们的难题。
下文就给伙伴们简单说下我的基础邮件配置经验:
1 开启邮箱的pop3/smtp服务,qq邮箱需要设置独立密码。
2 检查本机mail端: yum install mailx -y
3 编辑本地邮件服务配置文件信息
法1:分行编写
vim /etc/mail.rc
set from=523823198@qq.com
set smtp=smtp.qq.com
set smtp-auth-user=523823198
set smtp-auth-password=your password
set smtp-auth=login
法2:分行编写
set from=523823198@qq.com \
smtp=smtp.qq.com \
smtp-auth-user=523823198 \
smtp-auth-password=your password \
smtp-auth=login
法3:整行编写
set from=523823198@qq.com smtp=smtp.qq.com smtp-auth-user=523823198 smtp-auth-password=your password smtp-auth=login
4 发送邮件格式
mail -s "主题" *********@qq.com </data/邮箱测试
或者
echo "邮箱测试"|mail -s "主题" *********@qq.com
5 如果发送不成功
尝试关掉以下两项服务
/etc/init.d/postfix stop
/etc/init.d/sendmail stop
转载于:https://blog.51cto.com/momolinux/1717484