Email takes more time than usual to be sent

i used send email method in a custom app … called it with js on button click “send email”
any way at the beginning of project is send s immediately but now it takes more time i get Request time out in front end … but when check the email queue it send the email also i test it on my personal email and i received the email .
Q. Why it takes too much time to send email now ?
Q. How to handle the Request time out scenario in front end ?