
在 ubuntu 18.04 上安装 mailutils 后
$sudo apt-get install mailutils
我尝试在 CLI 上手动发送电子邮件
$mail -s test
To: [email protected]
Cc:
那……我该怎么办???
答案1
按enter
进入下一行。它将询问邮件主题,填写它或按enter
将其留空。您可以从下一行开始输入消息。Ctrl + D
完成后按一下,您的消息将被发送。
您甚至可以使用单行发送邮件。
mail -s "mail subject" [email protected] <<< 'your message here'
或来自文件
mail -s "mail subject" [email protected] < /home/user/mail.txt
只需确保您的 psotfix/ssmtp 配置正确即可。