drsoupy
Posts: 14
Joined: Fri May 31, 2013 4:03 am

Getting Pi to send email

Wed Jul 10, 2013 6:36 pm

Hello,

So currently I have my Pi set up when it reaches XX temperature, it will light up an LED. Pretty simple eh?
Well, now i want it so when it reaches XX temperature it will send me an email, does anyone know how i could do this?

I also have it set up when the Pi boots, it sends me an email with the local & external IP, so maybe i could pull some of the code from that?

Thanks!
- Dr.Soupy

User avatar
DeeJay
Posts: 2027
Joined: Tue Jan 01, 2013 9:33 pm
Location: East Midlands, UK

Re: Getting Pi to send email

Wed Jul 10, 2013 7:11 pm

I think you know how to do this... you've already tackled the most difficult parts.

You know how to send an email. So you know how to send an email saying "the temperature is now XX degrees"

You know how to measure the temperature, and how to take some action when the temperature reaches XX degrees.

For now the action is one step - light up the LED.

You just need the action to be TWO steps - 1] light up the LED; 2] send the email

Definitely reuse any code you have that is close to doing what you require.
How To Ask Questions The Smart Way: http://www.catb.org/~esr/faqs/smart-questions.html
How to Report Bugs Effectively: http://www.chiark.greenend.org.uk/~sgtatham/bugs.html

chorlton2080
Posts: 128
Joined: Sun Dec 23, 2012 9:44 pm

Re: Getting Pi to send email

Wed Jul 10, 2013 7:18 pm

Yes. I would say you have all the elements of what you would need already there. Now it is just thinking about the structure of the code as the previous post says and reuse.

Looks like a nice project.

Return to “General programming discussion”