发送电子邮件的shell脚本 [英] Shell script to send email

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

问题描述

我在 linux 机器上并监控进程使用情况.大部分时间我都会离开我的系统,我可以在我的设备上访问互联网.所以我打算写一个 shell 脚本,可以把这个过程的输出邮寄给我.

I am on linux machine and I monitor a process usage. Most of the time I will be away from my system and I have access to internet on my device. So I planned to write a shell-script that can mail me the output of the process.

有可能吗?

如果是这样,如何让 shell 脚本给我发送邮件?

If so how to make a shell-script send me mail?

请提供一个片段以开始使用.

Please provide a snippet to get started.

推荐答案

是的,它工作正常,常用:

Yes it works fine and is commonly used:

$ echo "hello world" | mail -s "a subject" someone@somewhere.com

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

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