0

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?

Community
  • 1
  • 1
sicklybeans
  • 299
  • 3
  • 11
  • no, but wikipedia says it's a windows program. This is all on linux – sicklybeans Aug 14 '13 at 22:41
  • If sendmail is installed (it almost always is) you can follow these steps: http://www.simplehelp.net/2008/12/01/how-to-send-email-from-the-linux-command-line/. Alternatively you can write a php script (hosted anywhere) that will send an email when it is accessed. Then use wget to access the page when the job completes. – ajon Aug 14 '13 at 22:44
  • blat for linux here: http://hgdownload.cse.ucsc.edu/admin/exe/ – fred02138 Aug 14 '13 at 22:45
  • Do you want to continue this discussion in chat: http://chat.stackoverflow.com/rooms/35483/sendmail-discussion – ajon Aug 14 '13 at 23:00
  • No thank you, I figured it out. I just didn't read the whole page – sicklybeans Aug 14 '13 at 23:02

2 Answers2

1

You can use sendmail. It is exactly what you are looking for. Here is an example:

Make a file named test.mail with the following lines:

Subject: test local
first line of my message
(compulsory blank line)

and do:

/usr/bin/sendmail -v your@emailaddress.com < test.mail
Daniel S.
  • 6,458
  • 4
  • 35
  • 78
0

If the machine is correctly configured to handle email, you could try mailx

mailx -s 'Hello World!' email@address.com <<- EOM
this is a test message
EOM
idfah
  • 1,328
  • 10
  • 16