How to send error message alerts to client

Hi everyone,

I’m running a project and some times I’m getting error due to client website server issue and i wanted to notify that to my client when ever bot throw an error , I want to update that error message to click through mail.
Can anyone help me how to solve this.