8000 minor #11965 Add attachment with url (LaurentMarquet) · symfony/symfony-docs@0b682b1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0b682b1

Browse files
committed
minor #11965 Add attachment with url (LaurentMarquet)
This PR was merged into the 4.3 branch. Discussion ---------- Add attachment with url Without this we may think (as I did until I tested) that it can only work with a file path and not with url <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/roadmap for the list of maintained branches). If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and `master` for features of unreleased versions). --> Commits ------- 165e128 Add attachment with url
2 parents f60e21b + 165e128 commit 0b682b1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

mailer.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,8 @@ Use the ``attachFromPath()`` method to attach files that exist on your file syst
200200
->attachFromPath('/path/to/documents/privacy.pdf', 'Privacy Policy')
201201
// optionally you can provide an explicit MIME type (otherwise it's guessed)
202202
->attachFromPath('/path/to/documents/contract.doc', 'Contract', 'application/msword')
203+
// you can also use an absolute url
204+
->attachFromPath('http://example.com/path/to/documents/contract.doc', 'Contract', 'application/msword')
203205
;
204206

205207
Alternatively you can use the ``attach()`` method to attach contents from a stream::

0 commit comments

Comments
 (0)
0