Send email when threshold is reached

Hi , I wanted to know if I could directly write python script to send email notification when the threshold value in A0 is reached.
(The script uses standard library smtplib)

Hi Sachin,

Yes, you can do that via script. We have a section dedicated to that in our course “” in which you have already enrolled.

We have instructed to use a third-party tool called Mailgun to send the email. If you want to do it via SMTP, please refer this blog. Rest of the code will remain the same apart from mail sending logic.

I tried using smtplib library from python standard library to send email alerts and succeded in doing so.
I’m attaching the code I have written for this project.
I’ve stored required credentials like gmail_user,gmail_pwd,to,bolt api,and device id in different files and imported them in this code.

1 Like

@nandinibangale.0211 Thats great! Why don’t you make a project based on it on