Skip to content

Commit

Permalink
Fix boundaries used in multi-part messages.
Browse files Browse the repository at this point in the history
Inline attachments should use the multipart/related boundary.  Otherwise
sections will be incorrectly nested.

Fixes #2413
  • Loading branch information
markstory committed Jan 12, 2012
1 parent 29cfdb4 commit 4d73f4e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/Cake/Network/Email/CakeEmail.php
Expand Up @@ -1323,7 +1323,7 @@ protected function _render($content) {
$msg[] = '--' . $boundary;
$msg[] = 'Content-Type: multipart/related; boundary="rel-' . $boundary . '"';
$msg[] = '';
$relBoundary = 'rel-' . $boundary;
$relBoundary = $textBoundary = 'rel-' . $boundary;
}

if ($hasMultipleTypes) {
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Test/Case/Network/Email/CakeEmailTest.php
Expand Up @@ -865,7 +865,7 @@ public function testSendWithInlineAttachments() {
"\r\n" .
"--alt-{$boundary}--\r\n" .
"\r\n" .
"--$boundary\r\n" .
"--rel-$boundary\r\n" .
"Content-Type: application/octet-stream\r\n" .
"Content-Transfer-Encoding: base64\r\n" .
"Content-ID: <abc123>\r\n" .
Expand Down

0 comments on commit 4d73f4e

Please sign in to comment.