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

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

问题描述

我知道有办法从Linux / MacOS终端发送电子邮件,但似乎找不到正确的文件。



基本上我需要它为我的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屋!

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