function mail_box() { $IMAP_READTIMEOUT = 1; // imap_timeout(1, $IMAP_READTIMEOUT) ; $mbox = imap_open("{pop.163.com:110/pop3/notls}", "wanghuafengc", "081013303"); $folders = imap_list($mbox, "{pop.163.com:110/pop3/}", "%"); if ($folders == false) { echo "Call failed<br />\n"; } else { foreach ($folders as $val) { echo $val . "<br />\n"; } } } mail_box(); function extract_mail() { $username = '******'; $password = '******'; // $imap = imap_open("{pop.163.com:995/pop3/ssl/novalidate-cert}", $username, $password); $imap = imap_open("{pop.163.com:110/pop3/notls}", $username, $password); // $imap = imap_open("{localhost:143}INBOX", "user_id", "password"); $message_count = imap_num_msg($imap); echo '$message_count:' . $message_count . "\n"; $header = imap_header($imap, 3877); echo $header->subject . "\n"; $subject = imap_mime_header_decode($header->subject); imap_close($imap); } //extract_mail();
$_SESSION['last_date'] = date_format($new[0]->getCreatedAt(), 'Y-m-d\\TH:i:s.u\\Z'); $response->success = true; $response->message = "Logged in"; $response->data = $user->getObjectId(); echo json_encode($response); } catch (ParseException $ex) { $response->success = false; $response->message = 'Error: Failed to login: '******'forgot') { (string) ($pass = uniqid()); $content = 'Here is the new password: '******'email'], $pass); mail_box($_POST['email'], 'New password', $content, 'forgot'); } if ($func == 'settings') { echo user_update($_POST['user_id'], $_POST['first'], $_POST['last'], $_POST['email'], $_POST['profile']); } if ($func == 'message') { $response = new Response(); $query = new ParseQuery("Chat"); $query->equalTo('objectId', $_POST['chat']); $chat = $query->first(); $query = new ParseQuery("_User"); $query->equalTo('objectId', $_POST['speaker']); $user = $query->first(); $chatter = new ParseObject("ChatLogs"); $chatter->set("speaker", $user); $chatter->set("Chat", $chat);