Sending email notifications
Email has become an inescapable tool for everyday use. It's arguably the best place to send a notification if an automated task has detected something. On the other hand, email inboxes are already too full up with spam messages, so be careful.
Spam filters are also a reality. Be careful with whom to send emails to and the number of emails to be sent. An email server or address can be labeled as a spam source
, and all emails may be quietly dropped by the internet.
This recipe will show you how to send a single email using an existing email account.
This approach is viable for spare emails sent to a couple of people, as a result of an automated task, but no more than that. Refer to Chapter 9, Dealing with Communication Channels, for more ideas on how to send emails, including groups.
Getting ready
For this recipe, we require a valid email account set up, which includes the following:
- A valid email server using SMTP...