RDS
Posts: 783
Joined: Tue Oct 06, 2015 8:17 am
Location: Lancashire, UK

Re: Sending email from RPi

Tue Nov 17, 2015 1:44 pm

@rst
Thanks for your comments.
Just to point out, I know what 'sudo' and 'apt-get' are for but what I did not know (and still don't) was what the rest of the line that Dougie had posted would do.
I must add though, that Dougie has been a tremendous help to me in my RPi learning experience.

User avatar
DougieLawson
Posts: 40518
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Sending email from RPi

Tue Nov 17, 2015 1:46 pm

RDS wrote: I must add though, that Dougie has been a tremendous help to me in my RPi learning experience.
Keep going, your stuff is interesting.
Any language using left-hand whitespace for syntax is ridiculous

Any DMs sent on Twitter will be answered next month.
Fake doctors - are all on my foes list.

Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

BillStephenson
Posts: 256
Joined: Thu May 17, 2012 1:25 am
Location: SW Missouri Ozarks
Contact: Website

Re: Sending email from RPi

Tue Nov 17, 2015 7:12 pm

elParaguayo wrote:I've used SMTP in python with gmail. If you go this way, I think you have to enable "access for less secure apps".

See here: https://support.google.com/accounts/ans ... 0255?hl=en
That's exactly what I ran into, and tried (a little) to resolve it without changing that setting. I wanted to add it as a feature for users, but requiring them to change that setting changed my mind, and I had other stuff to work on. I may get back to it.

-rst-
Posts: 1316
Joined: Thu Nov 01, 2012 12:12 pm
Location: Dublin, Ireland

Re: Sending email from RPi

Wed Nov 18, 2015 6:53 pm

http://raspberrycompote.blogspot.com/ - Low-level graphics and 'Coding Gold Dust'

User avatar
elParaguayo
Posts: 1943
Joined: Wed May 16, 2012 12:46 pm
Location: London, UK

Re: Sending email from RPi

Wed Nov 18, 2015 7:10 pm

I've used oauth2 for accessing my Google Calendar through python. It's a bit of hassle to set up (and every user would have to do it because you can't share your secret key), but works nicely once it's done.
RPi Information Screen: plugin based system for displaying weather, travel information, football scores etc.

RDS
Posts: 783
Joined: Tue Oct 06, 2015 8:17 am
Location: Lancashire, UK

Re: Sending email from RPi

Fri Nov 20, 2015 6:52 pm

It does look as though the problem I have, is to do with the less secure aps idea.
I don't use very often the alternative email address I gave when taking out my Pi gmail address but I have realised that I have 2 messages titled 'sign in attempt prevented'.
It seems therefore that my Pi may have attempted but not been successful in sending an email.

Question: If I set allow less secure apps on my Pi gmail address will that setting just apply to that one gmail address or would others be affected as well.

-rst-
Posts: 1316
Joined: Thu Nov 01, 2012 12:12 pm
Location: Dublin, Ireland

Re: Sending email from RPi

Mon Nov 23, 2015 2:11 pm

It is just for that one gmail account, so if you have (or create) a separate gmail account (and use a string enough password) it probably is not too big of a risk.
http://raspberrycompote.blogspot.com/ - Low-level graphics and 'Coding Gold Dust'

RDS
Posts: 783
Joined: Tue Oct 06, 2015 8:17 am
Location: Lancashire, UK

Re: Sending email from RPi

Mon Nov 23, 2015 10:09 pm

Thanks, rst

RDS
Posts: 783
Joined: Tue Oct 06, 2015 8:17 am
Location: Lancashire, UK

Re: Sending email from RPi

Tue Nov 24, 2015 9:01 am

An update:
The problem I was experiencing was due to the 'less secure apps' aspect.
I have now modified the settings for that email account and the Pi has successfully sent an email.

The next step will be to get it to send a string that has been generated in a program, rather than one a fixed that has just been typed into the python program. Then onto attachments!

-rst-
Posts: 1316
Joined: Thu Nov 01, 2012 12:12 pm
Location: Dublin, Ireland

Re: Sending email from RPi

Tue Nov 24, 2015 12:15 pm

Good to hear you make progress!

Just in case someone finds this useful: I finally remembered I had turned the less secure apps to 'on' so I could access my gmail account from a Windows Phone using the 'built-in' email app.
http://raspberrycompote.blogspot.com/ - Low-level graphics and 'Coding Gold Dust'

TxRider
Posts: 16
Joined: Tue Aug 14, 2018 4:45 pm

Sending email from RPi - Need Help with the Mutt Script

Wed Sep 26, 2018 6:04 am

Is there a certain file that I need to download to get the mutt script working with my gmail account? I’m too trying to send pics from my camera alerts from my motion and temp sensor when certain levels are reached. Thanks for your help!!

TxRider...

Return to “Python”