Skip to content

Commit

Permalink
DOC Document another exception to catch when dealing with email (#421)
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli authored Dec 14, 2023
1 parent 20051e8 commit ea47bc5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions en/02_Developer_Guides/10_Email/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,11 @@ $email->replyTo('[email protected]');

If you wish to handle email send failures then you can wrap `$email->send()` with a try/catch block that catches the Symfony Mailer `TransportExceptionInterface`.

[hint]
You might get a Symfony Mailer `RfcComplianceException` when instantiating the `Email` object if the email address you're trying to send to or from is invalid.
In some cases you'll want to catch and handle that exception as well.
[/hint]

```php
use SilverStripe\Control\Email\Email;
use Symfony\Component\Mailer\Exception\TransportExceptionInterface;
Expand Down

0 comments on commit ea47bc5

Please sign in to comment.