Skip to content

Update mailer.rst #13895

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 26, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions mailer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,30 @@ images inside the HTML contents::
->html('<img src="cid:logo"> ... <img src="cid:footer-signature"> ...')
;

Catching Transport Exceptions
-----------------------------

If handing over the email to your transport fails, a
:class:`Symfony\\Component\\Mailer\\Exception\\TransportExceptionInterface` is thrown. To
make sure that sending the email was successful, you can catch that exception::

use Symfony\Component\Mailer\Exception\TransportExceptionInterface;

$email = new Email();
// ...
try {
$mailer->send($email);
// Display message that email was successfully sent
} catch (TransportExceptionInterface $e) {
// Display message that sending the email failed
}

.. caution::

For Mailer, the sending process was successful, if your transport (SMTP
server or 3rd party provider) accepted the mail for further delivery. This
does not mean that the email has already arrived at the recipient's mail server.

Debugging Emails
----------------

Expand Down