cvs: pear /Mail_Mime mime.php
| From: | Cipriano Groenendal | Date: | Sun, 09 Apr 2006 14:36:11 +0000 |
| Subject: | cvs: pear /Mail_Mime mime.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-39507@lists.php.net to get a copy of this message | ||
cipri Sun Apr 9 14:36:11 2006 UTC
Modified files:
/pear/Mail_Mime mime.php
Log:
Fixed Bug #5837: getMessage() function to get complete message as string.
http://cvs.php.net/viewcvs.cgi/pear/Mail_Mime/mime.php?r1=1.47&r2=1.48&diff_format=u
Index: pear/Mail_Mime/mime.php
diff -u pear/Mail_Mime/mime.php:1.47 pear/Mail_Mime/mime.php:1.48
--- pear/Mail_Mime/mime.php:1.47 Sun Apr 9 14:18:48 2006
+++ pear/Mail_Mime/mime.php Sun Apr 9 14:36:11 2006
@@ -35,7 +35,7 @@
// | Tomas V.V.Cox <cox@idecnet.com> (port to PEAR) |
// +-----------------------------------------------------------------------+
//
-// $Id: mime.php,v 1.47 2006/04/09 14:18:48 cipri Exp $
+// $Id: mime.php,v 1.48 2006/04/09 14:36:11 cipri Exp $
require_once('PEAR.php');
require_once('Mail/mimePart.php');
@@ -463,6 +463,35 @@
}
/**
+ * Returns the complete e-mail, ready to send using an alternative
+ * mail delivery method. Note that only the mailpart that is made
+ * with Mail_Mime is created. This means that,
+ * YOU WILL HAVE NO TO: HEADERS UNLESS YOU SET IT YOURSELF
+ * using the $xtra_headers parameter!
+ *
+ * @param string $separation The separation etween these two parts.
+ * @param array $build_params The Build parameters passed to the
+ * &get() function. See &get for more info.
+ * @param array $xtra_headers The extra headers that should be passed
+ * to the &headers() function.
+ * See that function for more info.
+ * @return string The complete e-mail.
+ * @access public
+ */
+ function getMessage($separation = null, $build_params = null, $xtra_headers = null)
+ {
+ if ($separation === null)
+ {
+ $separation = MAIL_MIME_CRLF;
+ }
+ $body = $this->get($build_params);
+ $head = $this->txtHeaders($xtra_headers);
+ $mail = $head . $separation . $body;
+ return $mail;
+ }
+
+
+ /**
* Builds the multipart message from the list ($this->_parts) and
* returns the mime content.
*