Kentski
Posts: 4
Joined: Sat Nov 15, 2014 7:49 pm

Sending emails triggered by input

Mon Jun 08, 2015 4:13 pm

I am looking at the feasibility of retrofitting/updating my older DSC security system for internet use.

The first step is to see if I can use my Raspberry Pi B+ to send a pre determined Email alert triggered by an input event like a switch closure. I would like to use Gmail for the email service provider (existing account). My Pi is linked to my home network via WiFi and is set up for a static IP address.

I would appreciate any recommendations.

User avatar
RogerW
Posts: 286
Joined: Sat Dec 20, 2014 12:15 pm
Location: London UK

Re: Sending emails triggered by input

Tue Jun 09, 2015 2:23 pm

If you are using python to detect the switch then you might look at smtplib which is a standard python import. I have not tried it myself but it should allow you to send an email although you will have to set up all the details.

There may be an easier an easier way but since nobody else has replied I thought I would make this suggestion

Roger Woollett

Massi
Posts: 1691
Joined: Fri May 02, 2014 1:52 pm
Location: Italy

Re: Sending emails triggered by input

Tue Jun 09, 2015 2:26 pm

Kentski wrote:I am looking at the feasibility of retrofitting/updating my older DSC security system for internet use.

The first step is to see if I can use my Raspberry Pi B+ to send a pre determined Email alert triggered by an input event like a switch closure. I would like to use Gmail for the email service provider (existing account). My Pi is linked to my home network via WiFi and is set up for a static IP address.

I would appreciate any recommendations.
I'd use python.

1) detect event ("like a switch closure")
http://raspi.tv/2013/how-to-use-interru ... d-rpi-gpio

2) send mail whrough gmail
http://www.nixtutor.com/linux/send-mail ... th-python/

Return to “Beginners”