Light monitoring email and sms


This is the code i am getting again and again syntax error

Hi @virajent12
Your indentation is wrong after try: you have to left only one or two spaces before next line"sensor_value= int(data[‘value’])"
Try this and let me now if error still occurs

@Rohini I an still getting the same error

One closing bracket is missing at the end of line 12.

@Ekansh thanks i have made simple mistake


i am getting message and sms but what is the error

@virajent12 “response” variable was updated and has taken return value from send_sms() function. Try using a different variable for the return value of send_email().


I am getting this error and the email is not being recieved.What should be the solution pls help

I don’t understand can you explain it properly

Hi @virajent12,
the problem is:

response = mail.send_email(.....)
response=sms.send_sms(....)

Here you see, response contains a SMS response object, so the SMS code prints fine.

But then on the same SMS object, you are doing an operation that should be done on an email object.

To fix this, make two variables

email_response = mail.send_email(.....)
sms_response=sms.send_sms(....)

Then call appropriate methods and access appropriate fields on the respective objects.

@virajent12 send_email(subject, message) takes two parameters, and you have only provided one. You can fix this as:
mail.send_email(“Alert”,"the current value…)

Thanks
This is the mailgun response from parameter is not a valid address. please check documentation
can you tell me the above error issue

@raghav.srivastava
This is the mailgun response from parameter is not a valid address. please check documentation
can you tell me the above error issue

Hi @virajent12 ,
seems like an error with the Sender Email. Can you please share a screenshot of the conf file? (Hide any API Keys).

image

@raghav.srivastava pls tell me what is this error

@virajent12 can you please share a screenshot of the error so I can better understand it?

@virajent12 can you please share the first 10 characters of your sandbox URL?(Don’t share the entire URL)

sandboxe76
this is the 10 characters