P
P
photosho2016-01-07 00:14:15
Laravel
photosho, 2016-01-07 00:14:15

Is it possible to catch an error when sending mail?

I send mail via SMTP using the Mail class. Sometimes there is a connection error with the mail server - the server waits for 30 seconds and ends the script with an error:

Connection could not be established with host...

Is it possible to catch such errors?
PS try-catch doesn't want to catch for some reason...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
mustafo, 2016-01-08
@mustafo

Have you looked at Mail::failures() ?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question