Regarding Temperatue Project using e-mail


I generated the following code and it is showing following error. please help me fix it.

This is the code

This is the error

Here it is showing error: line 1 column 1 something


Hi @ksengar100,

To find out the exact issue, comment two lines after calling the send_sms function and directly print the response from the mailgun.

while True:
    print ("Reading sensor value")
    response = mybolt.analogRead('A0')
    data = json.loads(response)
    print ("Sensor value is: " + str(data['value']))
        sensor_value = int(data['value'])
        if sensor_value > maximum_limit or sensor_value < minimum_limit:
            print("Making request to Mailgun to send an email")
            response = mailer.send_email("Alert", "The Current temperature sensor value is " +str(sensor_value))
            #response_text = json.loads(response.text)
            #print ("Respose recieved from the mailgun is" + str(response_text['messae']))
            print ("Mailgun response is " + response.text)
    except Exception as e:
        print ("Error occured: Below are the details")
        print (e)

Also check if this thread helps Mailgun Error-Expecting value:line 1 column 1 (char 0)

Do let me know in case you need further assistance.