Mailgun Showing Error
To resolve this issue, first, check your API request and ensure that all required parameters are included and formatted correctly. Make sure that the payload is properly formatted as JSON and does not contain any extra data that is not recognized by the server.
Let us know if your query resolved
Bellow is my code could you please tell me where is the problem. I couldnāt recognized the problemā¦
Can you share the code so we can assist you.
**Bellow is my code**

import email_conf
from boltiot import Email, Bolt
import json, time
min= 300
max= 600
mybolt Bolt (email_conf.API_KEY, email_conf.DEVICE_ID)
mailer Email(email_conf.MAILGUN_API_KEY, email_conf. SANDBOX_URL, email_conf.SENDER_EMAIL, email_conf.RECIPIENT_EMAIL)
while True:
print (āReading Sensor Valueā)
response= mybolt.analogRead(āA0ā)
data= json. loads (response)
print ("Sensor value is "+str(data[āvalueā]))
try:
sensor_value=int(data[āvalueā])
temperature=(100xsensor_value)/1024
if sensor_value>max or sensor_value <min:
print(āMaking request to Mailgun to send emailā)
response-mailer.send_email(āAlertā, "The current temperature is "+str(temperature))
response_text = json. loads (response.text)
print ("Response recived from Mailgun is "+str(response_text [āmessageā]))
except Exception as e:
print(āError occured bellow are the detailesā)
print (e)
time.sleep(10)
The code is encountering multiple errors, some of which are:
Typographical errors:
Incorrect usage of quotes: The quotes used in the code are not standard quotes, which are causing a syntax error. Use either single quotes (ā ') or double quotes (" ") instead of the quotes used in the code.
Incorrect use of equals sign: The equals sign = is being used instead of the minus sign - in the following line: response-mailer.send_email(āAlertā, "The current temperature is "+str(temperature)).
Naming errors:
Incorrect class instantiation: The class instantiation for Bolt and Email is missing the = sign. Use mybolt = Bolt(email_conf.API_KEY, email_conf.DEVICE_ID) and mailer = Email(email_conf.MAILGUN_API_KEY, email_conf.SANDBOX_URL, email_conf.SENDER_EMAIL, email_conf.RECIPIENT_EMAIL).
Incorrect variable names: The variable name min shadows the built-in function min(), which is not recommended. Rename the variable to a more meaningful name, like min_value.
Incorrect mathematical operation:
The multiplication operator * is being represented as the letter x, causing a syntax error. Change 100xsensor_value to 100 * sensor_value.
I changed accordingly but problem is not solved