Can I insert more than one people to receive the alert email when my ID more than my setpoint?

2 vues (au cours des 30 derniers jours)
I create a Matlab code, react and time control...
The point is when my value (temperature) is more than a setpoint (eg. 25) send an email to me, but I'd like to send this alarm for many people.
Can I do it?
Since now, thank.
Regards,
Luis H. Migot

Réponses (1)

Jonas
Jonas le 1 Juil 2021
Modifié(e) : Jonas le 1 Juil 2021
yes you can, e.g. the sendmail() function supports multiple email addresses like
sendmail({'recipient@someserver.com','recipient2@someserver.com'}, ...
'Hello From MATLAB!');
you can find more documentation here
  4 commentaires
Luis Migot
Luis Migot le 1 Juil 2021
Hi Jonas,
I really I don't know where I am wrong...
I tried insert the part of authentication but it was not work...
I am using the free account in ThingSpeak, could be it?
The output:
1330104
LOW
Unable to run the 'Custom (no starter code) 3' function, because it is not supported for this product offering.
Caused by:
Error using matlab.internal.lang.capability.Capability.require (line 94)
This functionality is not available on remote platforms.
My code:
% Store the channel ID for the moisture sensor channel.
channelID = 1330104;
temperatureFieldID = 1;
readAPIKey = '0COBXP38TCKUAQ7H';
% Read the recent data.
temperatura = thingSpeakRead(channelID);
disp(channelID);
% Set the outgoing message
if temperatura < 20
msgAlert = ' low temperature ';
disp('LOW');
elseif temperatura > 20
msgAlert = ' high temperature';
disp('HIGH');
end
%props = java.lang.System.getProperties;
%props.setProperty('mail.smtp.auth','true');
%setpref('Internet','SMTP_Username','lhm21@lhm21.com.br');
%setpref('Internet','SMTP_Password','XXXXX');
setpref('Internet','E_mail','lhm21@lhm21.com.br');
setpref('Internet','SMTP_Server','mail.lhm21.com.br');
sendmail('lhm21@lhm21.com.br', "x");
Jonas
Jonas le 2 Juil 2021
i found a matlab blog about that, have a look here

Connectez-vous pour commenter.

Produits

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by