如何从终端发送电子邮件? [英] How to send email from Terminal?

查看:134
本文介绍了如何从终端发送电子邮件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道有很多方法可以从Linux的/ MacOS的终端发送电子邮件,但我似乎无法找到如何做到这一点适当的文件。

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.

基本上我需要它的每一个有在文件中的变化时通知我,我的bash脚本。

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.

您需要设置 SMTP 起来:

<一个href=\"http://hints.macworld.com/article.php?story=20081217161612647\">http://hints.macworld.com/article.php?story=20081217161612647

另请参阅:

<一个href=\"http://www.mactricksandtips.com/2008/09/send-mail-over-your-network.html\">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 的主题为你好和消息

This will send an email to example@example.com with the subject hello and the message

您好

世界

这篇关于如何从终端发送电子邮件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆