Temprature monitor with Email alert code error

any advice please!!! the code is showing error

this type of error

I would first recommend you to change or check all the indentation in your code where necessary. I guess in the except block some issue might be there as the indentation is huge.

Refer the following link to make sure the details required for sending e-mail is set up correctly:

Third important thing to note is that your python file cannot have the same name as a python module. So, try changing the name of the file to say for example “project_iot.py” and try running it.

Hopefully this solves all the error! :slight_smile: If any error is still there pls let us know.

:wink: small hint : In the body of send_mail() replace - str( ’ sensor_value ’ ) with str( sensor_value ), if you want to include temperature value in the mail.

1 Like

I have verified all indentation and mailgun info is right but showing same error (cannot import Bolt). please resolve it!!!

Can you please share the file name of the python file.

Also, did you install Boltiot module via pip ?

email_conf.py and email.py are two names first one is domain file another python which screenshot above
my last code for sms worked well but not this :thinking:
Already installed module according to lecture steps

yes! I just want to confirm something…so try changing ( or copying the same file with a different file name ) your “email.py” file to “say sending_email.py” or “IOT_email.py” , and then run and check whether it works.

check this link it shows how to use a command to rename the file :

Please let me know after you do that, if it worked or if it didn’t, but be careful during the process!! :slight_smile: .

its sensing value but showing error ==> unorderable types: int() < str()
so what should i change in code

can you send a screenshot so that i can know where its occuring?

sorry i missed directory as i went outstation urgently