Send email via MATLAB
Mostrar comentarios más antiguos
hello good I have problems receiving mail from thingspeak,
I receive data from a temp sensor and I have configured a reaction for when it exceeds 28 degrees send an email and it does not arrive
alert_body = 'SENSOR DE TEMPERATURA ISSCHILE';
alert_subject = 'Temperatura Elevada';
alert_api_key = 'TAK************';
alert_url= "https://api.thingspeak.com/alerts/send";
jsonmessage = sprintf(['{"subject": "%s", "body": "%s"}'], alert_subject,alert_body);
options = weboptions("HeaderFields", {'Thingspeak-Alerts-API-Key', alert_api_key; 'Content-Type','application/json'});
%result = webwrite(alert_url, jsonmessage, options);
6 comentarios
Rohit Anand
el 14 de Jul. de 2020
- You should never share your API keys on a public platform.
- I have noticed that you have commented out the last line of your code. Please uncomment and then try running the script. It should work just fine.
Antonio Palma
el 14 de Jul. de 2020
Antonio Palma
el 14 de Jul. de 2020
Antonio Palma
el 14 de Jul. de 2020
Rohit Anand
el 14 de Jul. de 2020
You are making your thingspeak requests too quickly. Bulk requests should not be any less than 15 seconds apart, and if your bulk request is large then you might have to wait extra time.
Check out this answer for reference...
This looks similar to your issue.
Is the email is being sent from a loop? Try using pause() function to produce delay in between the requests.
Vinod
el 14 de Jul. de 2020
The error message explicitly points to the problem "The server returned the status 429 with message "Too Many Requests" in response to the request to URL https://api.thingspeak.com/alerts/send." Please refer to the documentation of the API.
Respuestas (0)
Comunidades de usuarios
Más respuestas en ThingSpeak Community
Categorías
Más información sobre Programming en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!