F
Filament8mo ago
Zoltar

mail exception unable to manage try catch

How do I handle invalid domain error? I tried to insert the mail function inside a try catch construct, but the exception is not handled and show the error in img thnks
No description
Solution:
yes I use
No description
Jump to solution
9 Replies
Dennis Koch
Dennis Koch8mo ago
Did you actually import the exception class?
toeknee
toeknee8mo ago
Also... did you restart the queue if using a queue
Zoltar
ZoltarOP8mo ago
no man not imported
Dennis Koch
Dennis Koch8mo ago
Do it and try again.
Zoltar
ZoltarOP8mo ago
ok thanks its works
Dennis Koch
Dennis Koch8mo ago
Do you understand why?
toeknee
toeknee8mo ago
Fairly sure \ on the Exception should suffice too.
Solution
Zoltar
Zoltar8mo ago
yes I use
No description
Zoltar
ZoltarOP8mo ago
and ADD use Symfony\Component\Mailer\Exception\UnexpectedResponseException;

Did you find this page helpful?