Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Learning Beaglebone Python Programming
  • Table Of Contents Toc
  • Feedback & Rating feedback
Learning Beaglebone Python Programming

Learning Beaglebone Python Programming

By : Alexander C Hiam
close
close
Learning Beaglebone Python Programming

Learning Beaglebone Python Programming

By: Alexander C Hiam

Overview of this book

If you have experience with the Python language and are interested in getting started with electronics, then BeagleBone Black is the perfect platform for you and this book will provide you with the information you need.
Table of Contents (14 chapters)
close
close

SMTP


We've looked at various forms of displays that you can attach to your BeagleBone, but those are only useful when you're looking at it. If your BeagleBone is not accessible, for instance, it's monitoring something at your home while you're out, you might still need a way for it to send you information. One simple way to achieve this is to use Simple Mail Transfer Protocol (SMTP) to send e-mails from your BeagleBone. Save this code to a new file called email_sender.py by filling in your account's SMTP details:

import smtplib
from email.mime.text import MIMEText

SMTP_host = 'smtp.gmail.com'
SMTP_email = '[email protected]'
SMTP_pass = 'password'

def send_email(to, subject, body):
  msg = MIMEText(body)
  msg['Subject'] = subject
  msg['From'] = SMTP_email
  msg['To'] = to
  server = smtplib.SMTP_SSL(SMTP_host)
  server.login(SMTP_email, SMTP_pass)
  server.sendmail(SMTP_email, to, msg.as_string())

Note

Just like with IMAP, to retrieve e-mails, SMTP is a standard protocol and is used by...

Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Learning Beaglebone Python Programming
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon