No error in web app when mail gateway could not be reached

I recently found out that the mails of the last 2 weeks could not sent by InvoiceNinja because our mail gateway could not be reached.

The Mail config in the .env file looks like this:

MAIL_HOST=192.168.1.2
MAIL_PORT=2225
MAIL_FROM_ADDRESS="[email protected]"
MAIL_FROM_NAME="My Company"

In the Logfile ./storage/logs/invoiceninja.log we have the messages:

[2024-08-07 11:00:40] production.INFO: Trying to send to [email protected] 2024-08-07 11:00:40
[2024-08-07 11:00:40] production.INFO: Using mailer => smtp
[2024-08-07 11:00:40] production.INFO: Mailer failed with Connection could not be established with host “192.168.1.2:2225”: stream_socket_client(): Unable to connect to 192.168.1.2:2225 (Connection refused)

But in the react web app I did not get an error message when sending the mail. No timeout or anything, it just looked like the mail was successfully sent.

Why am I not getting an error here? Do I have to change our configuration somehow?

It is not possible to define an alternative mail host, if the primary one is not reachable, right?

Can you log into your invoiceninja server and ping your mail host or the IP address? Is your port blocked by a firewall or proxy or something? Have you tried sending an email from the desktop application? What version of invoiceninja are you using?

The mail host was down. I switched to our alternative one now and resent all the invoice mails.
I just did not realize at first that is was down because I did not get an error message in the InvoiceNinja web app.

I just wanted to ask why the app is not displaying an error when this happens. Because it looked like everything was ok when in reality no e-mails were being sent.