Company
Date Published
Author
Julian Sequeira
Word count
447
Language
English
Hacker News points
None

Summary

A Raspberry Pi was used as a host for cron jobs, serving as a basis for setting up an email notification service using Python's smtplib module. The process involved configuring an Application Password due to Google's 2-step Verification, which serves as the Gmail password for the script, enabling the sending of basic emails from a Gmail account. The steps included importing the smtplib module, specifying Gmail's SMTP server and port, performing a handshake with the .ehlo() function, initiating TLS Encryption, logging in with the App Password, and sending an email with a subject and body separated by a mandatory newline character. The example concluded with disconnecting from the SMTP server and an indication of successful email transmission. Future plans involve enhancing the script with MIME modules to allow formatted emails.