Receiving emails from a Spark Core

Is it at all possible to receive a predetermined email from the spark core. For instance, say if I had a light sensor hooked up and wanted to be alerted via email if the light went below or above a certain value?

If so could somebody point me in the right direction in terms of libraries that are needed, or an area in which I need to research, etc.

May I suggest you click the search button and enter “email” :wink:

Thanks, theres a lot of content but I can at least start reading up on how the SMTP protocol functions :smile:

So there is SMTP which works great with your local ISPs email but not with gmail etc. since they require HTTPS.

Another option is an intermediary like that can send mail with just a HTTP GET or POST.

Spark is also working on “web hooks” which is a Spark cloud based intermediary service.

1 Like

Thanks - I’ve been using Arduino’s for the last 12 months or so, and I am a bit overwhelmed with this board as it is very networked based, which is not my strong point. I am currently searching for videos on basic protocols that I have come across here in order to gain a better understanding.

Will certainly check out

So, where would the code for HTTP GET or POST go? Its just I’ve used GET to invoke a function from within the spark from the command line. Is there an object that needs instantiating in order to do this?

Hi @daz

You can use this library which is available from the web IDE Build button:

Or you can roll your own–it is not too hard.

Thanks @bko

I’ve also just come across an online course that provides an insight into most web services protocols including all the ones I’ve seen in this forum and the spark documentation, so I will get stuck into them as soon as I can.

Had a quick look at the API for pushingbox and looks similar to what I have been doing in the command line with the “curl” command. Also like the catflap example :slight_smile:

In regards to importing libraries like HttpClient, etc., how do I include them when using the Web IDE? I’m used to the Arduino where you simply drag them to a folder within documents called “library” and then include them within the main document.

Sorry for all the questions!

Here’s the good new doc for using libraries: