1,安裝mailx
使用sudo apt-get install mailx會出現兩個包選擇
heirloom-mailx和bsd-mailx
區別在於前者配置文件為/etc/nail.rc后者為/etc/mail.rc
我安裝了heirloom-mailx這個包
然后配置文件
set from=發送郵箱的地址xx@163.com set smtp=smtp.163.com set smtp-auth-user=xx@163.com set smtp-auth-password=password set smtp-auth=login
發送命令
echo "practice"| mailx -s "Title" xx@163.com