如何从终端发送邮件? [英] How to send email from Terminal?
问题描述
基本上我需要它为我的bash脚本通知我每次有一个文件的变化。
进入终端和类型 man mail
寻求帮助。
您需要设置 SMTP
up:
http: //hints.macworld.com/article.php?story=20081217161612647
另见:
http://www.mactricksandtips.com/2008 /09/send-mail-over-your-network.html
例如:
mail -shelloexample@example.com<< EOF
hello
world
EOF
这将发送一个电子邮件至 example@example.com
与主题 hello
和消息
您好
世界
I know there are ways to send email from terminal in Linux/MacOS, but I can't seem to find proper documentation on how to do that.
Basically I need it for my bash script that notifies me every time there is a change in a file.
Go into Terminal and type man mail
for help.
You will need to set SMTP
up:
http://hints.macworld.com/article.php?story=20081217161612647
See also:
http://www.mactricksandtips.com/2008/09/send-mail-over-your-network.html
Eg:
mail -s "hello" "example@example.com" <<EOF
hello
world
EOF
This will send an email to example@example.com
with the subject hello
and the message
Hello
World
这篇关于如何从终端发送邮件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!