1. 安装postfix,执行命令
sudo apt-get update sudo apt-get install mailutils
2. 配置postfix,编辑/etc/postfix/main.cf,修改
inet_interfaces = all
为
inet_interfaces = loopback-only
3. 重启postfix服务
sudo service postfix restart
4. 测试发邮件
echo "This is the body of the email" | mail -s "This is the subject line" example@qq.com
5. 检查邮件一般会在垃圾箱中