Hello @Lucas ,
The IoT Hub supports alerts which can be triggered based on 'meta' conditions.
You can eg. trigger an action group (for eg. email or SMS) based on conditions that are not related to single messages but related to the IoT Hub itself. The IoT Hub collects metrics. These metrics can trigger actions.
See also this MS Learn module.
If you want to send emails based on your own logic, you have to rely on email functionality in Azure resources like sending a message with eg. the SendGrid API (using a SendGrid account and an Azure function) or a logic app.
For example, I used the IoTHub message routing feature to send alerts to an Event Hub. These alert messages in the Event Hub were picked up by a Logic app:
To enrich the messages or make the alerting smarter (eg. sending a maximum of 1 message each X minutes) you can add Azure Stream Analytics in between the IoT Hub and the EventHub. (ASA then acts as a rule engine).