I would suggest to use the Get-MessageTrackingLog cmdlet of PowerShell. They also have an example in the documentation for that cmdlet:
Try something like below
$messages = Get-MessageTrackingLog -Server Mailbox01 -Start "01/21/2024 09:00:00" -End "03/21/2024 17:00:00" -Sender "London@gmail.com"
$messages.Count