Sending Email Using Python Smtplib Automate Email Sending Alerts

When you have a script running and you have logs set , you might also want to send yourself or colleagues, email alerts in case things go wrong or simply to let you know that your scripts ran to completion without any problems.

 

In this short notes, we take a look at sending email using Python. We will send our emails via Gmail.

Credits to sentdex.  You can check him out on Youtube.

In [13]:

 

In [14]:

 

In [15]:

 

 Check your email to see that email has been sent.
Hope this helps 🙂
Happy sending!
Want more information like this?

Similar Posts

  • |

    Pandas DataFrame and Series Alignment Python Notes

    This week we have a look at Data Alignment in Python In [1]:

      In [2]:

      Out[2]:

    In [3]:

      Out[3]:

    In [4]:

      Out[4]:

    In [6]:

      Out[6]: A B LA 0 1 GA 2 3 In [10]:

      Out[10]: A B C LA 0 1 2 NYC 3 4…

  • | |

    Coursera Capstone Project – Data Analysis and Interpretation

    What is it This week, I started the Data Analysis and Interpretation Capstone by Wesleyan University on Coursera. This is the final of 5 course specialisation. The capstone project is expected to take 4 weeks. With each week tackling and doing a major component of the Project work.   What is the objective The objective of…

  • |

    Quick Example and Walk-Through JSON with Python

    This is a quick to create a dictionary object , write it to a JSON file and then read back the file and convert it to a dictionary and access the items in the dictionary. Credit to : codebasics.  You can check him out on Youtube In [3]:

      In [6]:

      Out[6]:

    In [14]:…

  • | |

    Testing a Basic Linear Regression Model – Data Analysis and Intrepretation

    Testing a Basic Linear Regression Model Background My research work deals with Ghana, a country from the Gapminder dataset as has already been discussed from the beginning and progression through this course.     1)     Program  Code and Output

           #####################     OUTPUT BEGIN  #####################     Axes(0.125,0.125;0.775×0.775) Describe the centered…

  • | |

    Running a Random Forest – Data Analysis and Intrepretation

    Overview My research work deals with Ghana, a country from the Gapminder dataset as has already been discussed from the beginning and progression through this course. The variables in my observation dataset are all quantitative. For the purposes of this assignment, I have binned my quantitative target variable, Life Expectancy (lifeexpectancy) into a 2-level binary categorical target variable. I have named…

  • WindowsError: [Error 5] Access is denied: Anaconda Python Pip Installs and Upgrade

    I was trying to run a pip install ( pip install scikit-learn) and I encountered this error:

    This is the bit we are interested in ”

    ” if you look at the error it states “WindowsError” Hence the Access Denied error is due to not having the right level of privileges to carry…

Leave a Reply

Your email address will not be published. Required fields are marked *