@@ -279,29 +279,28 @@ images inside the HTML contents::
279
279
->html('<img src="cid:logo"> ... <img src="cid:footer-signature"> ...')
280
280
;
281
281
282
- Catching Transport Exceptions
283
- -----------------------------
282
+ Handling Sending Failures
283
+ -------------------------
284
+
285
+ Symfony Mailer considers that sending was successful when your transport (SMTP
286
+ server or third-party provider) accepts the mail for further delivery. The message
287
+ can later be lost or not delivered because of some problem in your provider, but
288
+ that's out of reach for your Symfony application.
284
289
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 ::
290
+ If there's an error when handing over the email to your transport, Symfony throws
291
+ a :class: `Symfony\\ Component\\ Mailer\\ Exception\\ TransportExceptionInterface `.
292
+ Catch that exception to recover from the error or to display some message ::
288
293
289
294
use Symfony\Component\Mailer\Exception\TransportExceptionInterface;
290
295
291
296
$email = new Email();
292
297
// ...
293
298
try {
294
299
$mailer->send($email);
295
- // Display message that email was successfully sent
296
300
} catch (TransportExceptionInterface $e) {
297
- // Display message that sending the email failed
301
+ // some error prevented the email sending; display an
302
+ // error message or try to resend the message
298
303
}
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
304
306
305
Debugging Emails
307
306
----------------
0 commit comments