-
-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Message: fixed wrong content type for .eml files added as attachment [C…
…loses #47]
- Loading branch information
Showing
3 changed files
with
93 additions
and
2 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
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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
|
||
/** | ||
* Test: Nette\Mail\Message - attachments. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
use Nette\Mail\Message; | ||
use Tester\Assert; | ||
|
||
|
||
require __DIR__ . '/../bootstrap.php'; | ||
|
||
require __DIR__ . '/Mail.php'; | ||
|
||
|
||
$mailer = new TestMailer; | ||
|
||
$mail = new Message; | ||
$mail->addAttachment(__DIR__ . '/files/example.eml', null, 'MESSAGE/RFC822'); | ||
$mailer->send($mail); | ||
|
||
Assert::match(<<<'EOD' | ||
MIME-Version: 1.0 | ||
X-Mailer: Nette Framework | ||
Date: %a% | ||
Message-ID: <%S%@%S%> | ||
Content-Type: multipart/mixed; | ||
boundary="--------%S%" | ||
----------%S% | ||
Content-Type: text/plain; charset=UTF-8 | ||
Content-Transfer-Encoding: 7bit | ||
----------%S% | ||
Content-Type: application/octet-stream | ||
Content-Transfer-Encoding: base64 | ||
Content-Disposition: attachment; filename="example.eml" | ||
Um%A%= | ||
----------%S%-- | ||
EOD | ||
, TestMailer::$output); |
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
Return-Path: <example@acm.org> | ||
To: Example <example@linux.local> | ||
Subject: Testing | ||
From: example <example@acm.org> | ||
Reply-To: example <example@acm.org> | ||
Sender: example@acm.org | ||
MIME-Version: 1.0 | ||
Content-Type: multipart/mixed; boundary="652b8c4dcb00cdcdda1e16af36781caf" | ||
Message-ID: <20050430192829.0489.example@acm.org> | ||
Date: Sat, 30 Apr 2005 19:28:29 -0300 | ||
|
||
|
||
--652b8c4dcb00cdcdda1e16af36781caf | ||
Content-Type: multipart/related; boundary="6a82fb459dcaacd40ab3404529e808dc" | ||
--6a82fb459dcaacd40ab3404529e808dc | ||
Content-Type: multipart/alternative; boundary="69c1683a3ee16ef7cf16edd700694a2f" | ||
--69c1683a3ee16ef7cf16edd700694a2f | ||
Content-Type: text/plain; charset=ISO-8859-1 | ||
Content-Transfer-Encoding: quoted-printable | ||
This is an HTML message. Please use an HTML capable mail program to read | ||
this message. | ||
--69c1683a3ee16ef7cf16edd700694a2f | ||
Content-Type: text/html; charset=ISO-8859-1 | ||
Content-Transfer-Encoding: quoted-printable | ||
|
||
<html> | ||
<head> | ||
<P>Hello</p> | ||
</body> | ||
</html> | ||
--69c1683a3ee16ef7cf16edd700694a2f-- | ||
|
||
--652b8c4dcb00cdcdda1e16af36781caf-- |