diff --git a/en/appendices/5-3-migration-guide.rst b/en/appendices/5-3-migration-guide.rst index 3e944f1e73..534caedf7c 100644 --- a/en/appendices/5-3-migration-guide.rst +++ b/en/appendices/5-3-migration-guide.rst @@ -58,9 +58,15 @@ Console Database -------- -- Added ``Query::getDriver()`` helper which returns the ``Driver`` for the current connection +- Added ``Query::getDriver()`` helper which returns the ``Driver`` for the current connection role by default. +Mailer +------ + +- Added ``Message::addAttachment()`` for adding attachments to a message. Like + other message methods, it can be accessed via the ``Mailer`` instance as ``$mailer->addAttachment()``. + Routing ------- diff --git a/en/core-libraries/email.rst b/en/core-libraries/email.rst index 2256268e8d..f6f05df561 100644 --- a/en/core-libraries/email.rst +++ b/en/core-libraries/email.rst @@ -278,6 +278,12 @@ you want the filenames to appear in the recipient's mail client: a string using the ``data`` option. This allows you to attach files without needing file paths to them. +.. php:method:: addAttachment(\Psr\Http\Message\UploadedFileInterface|string $path, ?string $name, ?string $mimetype, ?string $contentId, ?bool $contentDisposition) + +You can also add attachments using the ``addAttachment()`` method. + + $mailer->addAttachment('/full/file/path/file.png'); + Relaxing Address Validation Rules ---------------------------------