PHP Classes

File: examples/receive_default_label.php

Recommend this page to a friend!
  Classes of Ve Bailovity   GmAtom   examples/receive_default_label.php   Download  
File: examples/receive_default_label.php
Role: Example script
Content type: text/plain
Description: Receives default number of new messages from certain label
Class: GmAtom
Access Gmail mailboxes retrieving XML Atom feeds
Author: By
Last change: Access without login.
Date: 17 years ago
Size: 944 bytes


Class file image Download
 * Receive default number of new messages from label 'mylabel'.
 * Note: no body excerpts are gathered in this example.
 * Created on 11-Nov-06.
 * @package gmTest
 * @author Vladislav Bailovic <>

include ('../gmatom.php');

$g = new GmAtom ('username', 'password');
$msgCount = $g->check();
if (
false === $msgCount) {
    die (
} else {
"<h1>".$msgCount." messages</h1>";
$g->sortBy('subject', true);
    foreach (
$g->messages as $mid=>$msg) {
/* If you need message bodies as well, you could do $msg->getBody(); here. */
    /* Then, you could echo $msg->body, or whatever */
echo '<dt>'.$mid.': <B>'.$msg->from.'</b> '.$msg->subject.'</dt>';
'<dd>'.date('r', $msg->timestamp)." ({$msg->date})".'</dd>';
'<dd><a href="'.$msg->link.'">'.$msg->link.'</a></dd>';