So I have to run huge jobs on a linux computing cluster and I want to write a script that will email me when the jobs finish. I don't care about what the sending email server is, but I want it to send the result to my gmail account. I tried sending it directly via telnet, but I ran into this problem Sending mail from smtp protocol in telnet. I'm thinking that maybe I should send it through my gmail account to my gmail account. But I have no idea how to do this from terminal/within a script. Any ideas?
所以我必须在Linux计算集群上运行大量工作,我想编写一个脚本,当作业完成时会通过电子邮件发送给我。我不关心发送电子邮件服务器是什么,但我希望它将结果发送到我的Gmail帐户。我尝试通过telnet直接发送它,但我遇到了这个问题从telnet中的smtp协议发送邮件。我想也许我应该通过我的gmail帐户发送到我的Gmail帐户。但我不知道如何从终端/脚本中执行此操作。有任何想法吗?
2 个解决方案
#1
1
You can use sendmail. It is exactly what you are looking for. Here is an example:
你可以使用sendmail。这正是你要找的。这是一个例子:
Make a file named test.mail with the following lines:
使用以下行创建名为test.mail的文件:
Subject: test local
first line of my message
(compulsory blank line)
and do:
并做:
/usr/bin/sendmail -v your@emailaddress.com < test.mail
#2
0
If the machine is correctly configured to handle email, you could try mailx
如果机器配置正确以处理电子邮件,您可以尝试mailx
mailx -s 'Hello World!' email@address.com <<- EOM
this is a test message
EOM
#1
1
You can use sendmail. It is exactly what you are looking for. Here is an example:
你可以使用sendmail。这正是你要找的。这是一个例子:
Make a file named test.mail with the following lines:
使用以下行创建名为test.mail的文件:
Subject: test local
first line of my message
(compulsory blank line)
and do:
并做:
/usr/bin/sendmail -v your@emailaddress.com < test.mail
#2
0
If the machine is correctly configured to handle email, you could try mailx
如果机器配置正确以处理电子邮件,您可以尝试mailx
mailx -s 'Hello World!' email@address.com <<- EOM
this is a test message
EOM