File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -279,6 +279,30 @@ images inside the HTML contents::
279279 ->html('<img src="cid:logo"> ... <img src="cid:footer-signature"> ...')
280280 ;
281281
282+ Catching Transport Exceptions
283+ -----------------------------
284+
285+ If handing over the email to your transport fails, a
286+ :class: `Symfony\\ Component\\ Mailer\\ Exception\\ TransportExceptionInterface ` is thrown. To
287+ make sure that sending the email was successful, you can catch that exception::
288+
289+ use Symfony\Component\Mailer\Exception\TransportExceptionInterface;
290+
291+ $email = new Email();
292+ // ...
293+ try {
294+ $mailer->send($email);
295+ // Display message that email was successfully sent
296+ } catch (TransportExceptionInterface $e) {
297+ // Display message that sending the email failed
298+ }
299+
300+ .. caution ::
301+
302+ For Mailer, the sending process was successful, if your transport (SMTP
303+ server or 3rd party provider) accepted the mail for further delivery. This
304+ does not mean that the email has already arrived at the recipient's mail server.
305+
282306Debugging Emails
283307----------------
284308
You can’t perform that action at this time.
0 commit comments