Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
BeagleBone By Example

You're reading from  BeagleBone By Example

Product type Book
Published in Aug 2016
Publisher Packt
ISBN-13 9781785285059
Pages 262 pages
Edition 1st Edition
Languages

Table of Contents (17) Chapters

BeagleBone By Example
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
1. Getting Started with BeagleBone 2. Circuit Fundamentals and GPIO 3. Introduction to Physical Computing Systems 4. Real-time Physical Computing Systems Using BeagleBone 5. Connecting Physical Computing Systems to the Internet 6. Home Automation Using BeagleBone 7. Working with Images Using Computer Vision 8. Home Security Systems Using BeagleBone Black 9. Exploring Robotics 10. Building Your Own Robot Index

Sending e-mail with an attachment from BeagleBone Black


Like the OpenCV library to work with images and camera on BeagleBone Black with Python, we have many other wonderful libraries that are developed and are built in Python. One such library is the SMTP e-mail library, which we will be using in this section.

To test this, we will use the image we captured in the project in the previous chapter, available inside the ImageCapture folder.

We will change our working directory to the ImageCapture directory first, as shown in the following screenshot, using cd ImageCapture:

Then, we will go ahead and create a Python file with code to send an e-mail with an attachment in it. To do that, first create a new file named sendemail.py, using sudo nano sendemail.py:

Now, type in the code shown in the following screenshot and save the file inside the ImageCapture folder itself. The code has been written with comments on most of the lines for you to get a clear idea of how it works.

You'll see that the Photo...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime}