0

What is the most efficient way to send an email from a wi-fi connected BeagleBone Black using the Cloud9 IDE and Bonescript?

I can use Node on the BBB to run the following code and send an email using ssmtp, but have not been able to get this to work from a script inside the Cloud9 IDE.

function sendMyEmail() {
    var flag = true;
    if (flag === true) {
        var sys = require('sys')
        var exec = require('child_process').exec;
        function puts(error, stdout, stderr) { sys.puts(stdout) }
        exec("ssmtp -t < ~/Desktop/email.txt", puts);

        flag = false;
    }
}
sendMyEmail();
Dave Nelson
  • 166
  • 4
  • What's your question here? What do you want? It's very unclear here if you're asking for the "best" way to send email - which is not a good question - or if you're asking for why that code doesn't work, in which case, we need more detail. – Avery Jun 10 '14 at 15:25
  • Avery, I am asking how to send an email using the Cloud9 IDE and Bonescript. My example is what I tried and did not work. – Dave Nelson Jun 10 '14 at 23:51
  • From what I saw on a quick search of "Cloud9 IDE", I saw that it's an online webapp that acts as an IDE. Correct me if I'm wrong on that. If that's true though, there's a fairly simple reason this doesn't work: Cloud9 is not your BBB. It really doesn't matter how you're connected to Cloud9, it can't read files or execute programs on your computer. It can **only** execute programs on the server. In other words, you need a different way to do this that doesn't involve files on your desktop or executing a local program. – Avery Jun 11 '14 at 11:51
  • Avery, the BBB Debian image comes with the Cloud9 IDE installed locally and you can use it to program the BBB using JavaScript with Node.js with a Node module called Bonescript. http://beagleboard.org/Support/BoneScript – Dave Nelson Jun 11 '14 at 23:40
  • Well. That's not what I found re: Cloud9 normally. Interesting then. I suppose the next question then is: Define not working. What does it do **exactly**? – Avery Jun 11 '14 at 23:47

0 Answers0