sudo apt-get install heirloom-mailx
sudo nano /etc/nail.rc 添加網易163郵箱開放的須要認證的smtp服務器:
shell
set from=USER@163.com set smtp=smtp.163.com set smtp-auth-user=USER set smtp-auth-password=PASSWORD set smtp-auth=login
其中USER@163.com是你的163郵箱,PASSWORD是你郵箱的密碼. 服務器
echo "郵件內容" | heirloom-mailx -s "郵件標題" 123@qq.com
加參數v能夠看到mail輸出的詳細(Verbose)信息: spa
echo "郵件內容" | heirloom-mailx -vs "郵件標題" 123@qq.com