<?php
-?>
\ No newline at end of file
+$mbox = imap_open("{localhost:143/novalidate-cert}INBOX", "test2", "!pa55w0rd");
+
+
+$folders = imap_getmailboxes($mbox, "{localhost:143/novalidate-cert}", "*");
+
+ foreach ($folders as $key => $val) {
+ echo "($key) ";
+ echo imap_utf7_decode($val->name) . ",";
+ echo "'" . $val->delimiter . "',";
+ echo $val->attributes . "<br />\n";
+ }
+
+print_r($folders);
+
+imap_createmailbox($mbox, imap_utf7_encode("{localhost:143/novalidate-cert}sms"));
+
+$xml = simplexml_load_file("/home/paulr/Documents/SmsBackups/SMS-WinMobile-11-Aug-2010.xml");
+
+foreach($xml as $key => $val) {
+ echo "key, val: $key, $val\n";
+ echo "valbody: ".$val["body"]."\n";
+ print_r($key);
+ print_r($val);
+
+ imap_createmailbox($mbox, imap_utf7_encode("{localhost:143/novalidate-cert}sms.".$val["address"]));
+
+ imap_append($mbox, "{localhost:143/novalidate-cert}sms.".$val["address"], "From: ".$val["address"]."\r\nDate: ".date(DATE_RFC822,((int)($val["date"])))."\r\n\r\n".$val["body"]."\r\n");
+}
+
+exit(0);
+
+?>