下面我直接描述邮件发送成功的经过:
1、安装heirloom-mailx
apt install heirloom-mailx
Ubuntu16.04 ,配置文件为/etc/s-nail.rc,把下面几行放置在最后
如果不配置端口发送可以使用
set from="15556728@163.com"
set smtp="smtps://smtp.163.com:465"
set smtp-auth-user="15556728@163.com"
set smtp-auth-password="91126wang"
set smtp-auth=login
如果配置端口则
set from="xxx@163.com"
set smtp="smtps://smtp.163.com:465"
set smtp-auth-user="xxxm@163.com"
set smtp-auth-password="123456"
set smtp-auth=login
2、发送
echo ‘this is test’ | mail -s “test email.” 123@qq.com
3、编写邮件发送脚