-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DOC Document another exception to catch when dealing with email (#421)
- Loading branch information
1 parent
20051e8
commit ea47bc5
Showing
1 changed file
with
5 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
|