Hello @Sera Nur DARKILIÇ ,
so the solution looks like this:
device sends messages (with distance) -> IoT Hub
What you want is:
device sends messages (with distance) -> IoT Hub -> some logic checks the messages and takes a decision -> email
In an IoT solution, typically a Stream Analytics job is used because it can take decisions on messages in-flight.
For sending emails, a Logic app (with eg. outlook.com integration) is a nice addition due to the visual editor and business integration with many services.
Then, a possible solution could be:
device sends messages (with distance) -> IoT Hub -> Stream Analytics Job -> eventhub (as 'glue') -> Logic app -> email