[cvs] [Wiki] changed: Doc/Dev/MIMEPackage

Jan Schneider jan at horde.org
Fri Feb 29 17:24:09 UTC 2008


jan  Fri, 29 Feb 2008 12:24:09 -0500

Modified page: http://wiki.horde.org/Doc/Dev/MIMEPackage
New Revision:  3.5
Change log:  Add different headers approach

@@ -126,8 +126,29 @@
 /* Get message subject. */
 $headers = new MyHeaders($message_uid);
 $headers->buildHeaders();
 $subject = $headers->getValue('Subject');
+</code>
+
++++ Different approach
+
+If the headers can't be received from an IMAP server or already are
available as a string, this alternative approach could be used:
+
+<code type="php">
+$headerText = 'Return-Path: <john at example.com>
+Message-ID: <20080228160832.604925ntqxdo4o00 at example.com>
+Date: Thu, 28 Feb 2008 16:08:32 +0100
+From: John Doe <john at example.com>
+To: jane at example.com
+Subject: Some Subject';
+
+/* Load libraries. */
+require_once 'Horde/MIME/Structure.php';
+//require_once 'Horde/NLS.php';
+
+/* Get message subject. */
+$headers = MIME_Structure::parseMIMEHeaders($headerText);
+$subject = $headers['Subject'];
 </code>

 ++ Complete example script


More information about the cvs mailing list