我知道有多种方法可以在 Linux/MacOS 中从终端发送电子邮件,但我似乎找不到有关如何执行此操作的正确文档。
基本上,我的 bash 脚本需要它,每次文件发生更改时都会通知我。
最佳答案
进入终端并输入 man mail
寻求帮助。
您需要设置 SMTP
:
http://hints.macworld.com/article.php?story=20081217161612647
也可以看看:
http://www.mactricksandtips.com/2008/09/send-mail-over-your-network.html
例如:
mail -s "hello" "example@example.com" <<EOF
hello
world
EOF
这将向 example@example.com
发送一封电子邮件,主题为 hello
和消息关于bash - 如何从终端发送电子邮件?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/8260858/