Sending Emails With the Omega using Python

Since the Omega runs Linux, you can run an SMTP client on it and get it to send emails. For example, you can use this feature on connected hardware projects like a switch or a door bell, it can email you if there’s any new activity.

Step 1: Install mailsend

opkg update
opkg install mailsend

Step 2: Send email with the command line with mailsend

This step assumes that you have setup an SMTP server or have access to services such as Amazon’s Simple Email Service (SES).

mailsend -to -from -ssl -port 465 -auth-login -smtp -sub test +cc +bc -v -user -pass “p@ssw0rd” -M "Your message here"

Step 3: Sending Emails via Python Script

Install Python

opkg update
opkg install python

Write the script to send an email


import smtplib

sender = ''
toaddrs = ''

message = """From: Onion Omega
To: Recipient < >
Subject: SMTP e-mail test

This is a test e-mail message.

# Credentials
password = 'yourpasswordhere'

# The actual mail send
server = smtplib.SMTP_SSL('')		# (‘Host:Port’)
server.sendmail(sender, toaddrs, message)

print "done"

Another example to send email using SSL via python


Thanks to Shamyl Mansoor for writing this awesome tutorial!