Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit be6bad8

Browse files
authored
Update inline part names with newly generated ContentId
Inline parts are identified by matching attachment names to cids found in the html part. In line 487 cids are regenerated and replaced in the html part, but the attachment names were not similarly replaced.
1 parent fe57893 commit be6bad8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Symfony/Component/Mime/Email.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,8 @@ private function prepareParts(): ?array
485485
$attachment['inline'] = true;
486486
$inlineParts[$name] = $part = $this->createDataPart($attachment);
487487
$html = str_replace('cid:'.$name, 'cid:'.$part->getContentId(), $html);
488+
$part->setName($part->getContentId());
489+
$attachment['name'] = $part->getContentId();
488490
continue 2;
489491
}
490492
$attachmentParts[] = $this->createDataPart($attachment);

0 commit comments

Comments
 (0)