To: recipient@example.com
From: sender@example.com
Message-ID: <%d.%s@mail.example.com>
-User-Agent: Horde Application Framework 4.0
+User-Agent: Horde Application Framework 4
Date: %s, %d %s %d %d:%d:%d %s%d
Content-Type: text/plain; charset=iso-8859-15; format=flowed; DelSp=Yes
MIME-Version: 1.0
-Content-Disposition: inline
-Content-Transfer-Encoding: 7bit
This is
the body
To: recipient@example.com
From: sender@example.com
Message-ID: <%d.%s@mail.example.com>
-User-Agent: Horde Application Framework 4.0
+User-Agent: Horde Application Framework 4
Date: %s, %d %s %d %d:%d:%d %s%d
Content-Type: text/plain; charset=iso-8859-15; format=flowed; DelSp=Yes
MIME-Version: 1.0
-Content-Disposition: inline
-Content-Transfer-Encoding: 7bit
This is
the body
From: sender@example.com
Cc: Der =?iso-8859-15?b?c2No9m5l?= Peter <peter@example.com>
Message-ID: <%d.%s@mail.example.com>
-User-Agent: Horde Application Framework 4.0
+User-Agent: Horde Application Framework 4
Date: %s, %d %s %d %d:%d:%d %s%d
Content-Type: text/plain; charset=iso-8859-1; format=flowed; DelSp=Yes
MIME-Version: 1.0
-Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
H=FCbsche Umlaute
To: recipient@example.com
From: sender@example.com
Message-ID: <%d.%s@mail.example.com>
-User-Agent: Horde Application Framework 4.0
+User-Agent: Horde Application Framework 4
Date: %s, %d %s %d %d:%d:%d %s%d
Content-Type: multipart/mixed; boundary="=_%s"
MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
This message is in MIME format.
--=_%s
Content-Type: text/plain; charset=iso-8859-15; format=flowed; DelSp=Yes
-Content-Disposition: inline
-Content-Transfer-Encoding: 7bit
This is
the body
--=_%s
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
-Content-Transfer-Encoding: 7bit
This is a plain text
--=_%s
require dirname(__FILE__) . '/mail_dummy.inc';
require_once 'Horde/String.php';
require_once 'Horde/Text/Filter.php';
+require_once 'Horde/Text/Filter/Base.php';
require_once 'Horde/Text/Filter/Html2text.php';
require_once 'Horde/Util.php';
+$mailer = new Mail_dummy();
$mail = new Horde_Mime_Mail(array('subject' => 'My Subject',
'to' => 'recipient@example.com',
'from' => 'sender@example.com'));
$mail->setBody("This is\nthe plain text body.");
-echo $mail->send(array('type' => 'dummy'));
+$mail->send($mailer);
+echo $mailer->send_output;
echo "====================================================================\n";
'from' => 'sender@example.com'));
$mail->setHTMLBody("<h1>Header Title</h1>\n<p>This is<br />the html text body.</p>",
'iso-8859-1', false);
-echo $mail->send(array('type' => 'dummy'));
+$mail->send($mailer);
+echo $mailer->send_output;
echo "====================================================================\n";
'from' => 'sender@example.com'));
$mail->setHTMLBody("<h1>Header Title</h1>\n<p>This is<br />the html text body.</p>");
-$dummy = Mail::factory('dummy');
-$mail->send($dummy);
-echo $dummy->send_output;
+$mail->send($mailer);
+echo $mailer->send_output;
?>
--EXPECTF--
To: recipient@example.com
From: sender@example.com
Message-ID: <%d.%s@mail.example.com>
-User-Agent: Horde Application Framework 4.0
+User-Agent: Horde Application Framework 4
Date: %s, %d %s %d %d:%d:%d %s%d
Content-Type: text/plain; charset=iso-8859-1; format=flowed; DelSp=Yes
MIME-Version: 1.0
-Content-Disposition: inline
-Content-Transfer-Encoding: 7bit
This is
the plain text body.
To: recipient@example.com
From: sender@example.com
Message-ID: <%d.%s@mail.example.com>
-User-Agent: Horde Application Framework 4.0
+User-Agent: Horde Application Framework 4
Date: %s, %d %s %d %d:%d:%d %s%d
Content-Type: text/html; charset=iso-8859-1
MIME-Version: 1.0
-Content-Disposition: inline
-Content-Transfer-Encoding: 7bit
<h1>Header Title</h1>
<p>This is<br />the html text body.</p>
To: recipient@example.com
From: sender@example.com
Message-ID: <%d.%s@mail.example.com>
-User-Agent: Horde Application Framework 4.0
+User-Agent: Horde Application Framework 4
Date: %s, %d %s %d %d:%d:%d %s%d
Content-Type: multipart/alternative; boundary="=_%s"
MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
This message is in MIME format.
--=_%s
Content-Type: text/plain; charset=iso-8859-1; format=flowed; DelSp=Yes
Content-Description: Plaintext Version of Message
-Content-Disposition: inline
-Content-Transfer-Encoding: 7bit
-
-
HEADER TITLE
--=_%s
Content-Type: text/html; charset=iso-8859-1
Content-Description: HTML Version of Message
-Content-Disposition: inline
-Content-Transfer-Encoding: 7bit
<h1>Header Title</h1>
<p>This is<br />the html text body.</p>
To: recipient@example.com
From: sender@example.com
Message-ID: <%d.%s@mail.example.com>
-User-Agent: Horde Application Framework 4.0
+User-Agent: Horde Application Framework 4
Date: %s, %d %s %d %d:%d:%d %s%d
Content-Type: multipart/mixed; boundary="=_%s"
MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
This message is in MIME format.
--=_%s
Content-Type: text/plain; charset=iso-8859-15; format=flowed; DelSp=Yes
-Content-Disposition: inline
-Content-Transfer-Encoding: 7bit
This is
the body
--=_%s
Content-Type: text/html; charset=iso-8859-15; name=my_name.html
Content-Disposition: attachment; filename=my_name.html
-Content-Transfer-Encoding: 7bit
<?php
/**
require dirname(__FILE__) . '/../../../lib/Horde/Mime/Part.php';
$_SERVER['SERVER_NAME'] = 'mail.example.com';
-class Mail_dummy extends Mail {
- function send($recipients, $headers, $body)
+class Mail_dummy extends Mail
+{
+ public $send_output;
+
+ public function send($recipients, $headers, $body)
{
list(,$text_headers) = Mail::prepareHeaders($headers);
- return $text_headers . "\n\n" . $body;
+ $this->send_output = $text_headers . "\n\n" . $body;
}
}
require_once 'Horde/String.php';
require_once 'Horde/Util.php';
-$dummy = Mail::factory('dummy');
+$dummy = new Mail_dummy();
$mail = new Horde_Mime_Mail(array('subject' => 'My Subject',
'body' => "This is\nthe body",
echo "====================================================================\n";
$mail->addHeader('To', 'Änderung <other@example.com>', 'utf-8');
-$raw = $mail->send(array('type' => 'dummy'));
$mail->send($dummy);
$raw = $dummy->send_output;
+echo $raw;
preg_match('/^Message-ID: (.*)$/m', $raw, $id2);
echo "====================================================================\n";
To: recipient@example.com
From: sender@example.com
Message-ID: <%d.%s@mail.example.com>
-User-Agent: Horde Application Framework 4.0
+User-Agent: Horde Application Framework 4
Date: %s, %d %s %d %d:%d:%d %s%d
Content-Type: text/plain; charset=iso-8859-15; format=flowed; DelSp=Yes
MIME-Version: 1.0
-Content-Disposition: inline
-Content-Transfer-Encoding: 7bit
This is
the body
====================================================================
Subject: My Subject
From: sender@example.com
-User-Agent: Horde Application Framework 4.0
+User-Agent: Horde Application Framework 4
Content-Type: text/plain; charset=iso-8859-15; format=flowed; DelSp=Yes
MIME-Version: 1.0
-Content-Disposition: inline
-Content-Transfer-Encoding: 7bit
To: =?utf-8?b?w4RuZGVydW5n?= <other@example.com>
Message-ID: <%d.%s@mail.example.com>
Date: %s, %d %s %d %d:%d:%d %s%d
Subject: My Subject
To: recipient@example.com
Message-ID: <%d.%s@mail.example.com>
-User-Agent: Horde Application Framework 4.0
+User-Agent: Horde Application Framework 4
Date: %s, %d %s %d %d:%d:%d %s%d
Content-Type: text/plain; charset=iso-8859-1; format=flowed; DelSp=Yes
MIME-Version: 1.0
-Content-Disposition: inline
-Content-Transfer-Encoding: 7bit
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad
class Mail_dummy extends Mail
{
- var $send_output;
+ public $send_output;
- function send($recipients, $headers, $body)
+ public function send($recipients, $headers, $body)
{
list(,$text_headers) = Mail::prepareHeaders($headers);
$this->send_output = $text_headers . "\n\n" . $body;