From e203cdb610d9b32d22fce23ae8af158b95bb0b8c Mon Sep 17 00:00:00 2001 From: paulr Date: Wed, 11 Aug 2010 15:48:42 +1000 Subject: [PATCH] meh --- push.php | 33 ++++++++++++++++++++++++++++++++- 1 files changed, 32 insertions(+), 1 deletions(-) diff --git a/push.php b/push.php index dc10d56..79facfd 100644 --- a/push.php +++ b/push.php @@ -1,4 +1,35 @@ \ 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 . "
\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); + +?> -- 1.7.0.4