Temprature sensor using email

How to resolve this error…???

The indentation of time.sleep(10) should be with the block containing except. The last part of the code should be within try:
so here there is an indentation error. Just write time.sleep in the same block of except and the error will be gone.