PHP Classes

File: examples/check_multiple.php

Recommend this page to a friend!
  Classes of Ve Bailovity   GmAtom   examples/check_multiple.php   Download  
File: examples/check_multiple.php
Role: Example script
Content type: text/plain
Description: Check multiple accounts
Class: GmAtom
Access Gmail mailboxes retrieving XML Atom feeds
Author: By
Last change: Access without login.
Date: 18 years ago
Size: 845 bytes
 

Contents

Class file image Download
<?php
/**
 * Check mail for multiple Gmail accounts.
 * Note the (bool)true parameter to check() method.
 *
 * Created on 11-Nov-06.
 *
 * @package gmTest
 * @author Vladislav Bailovic <malatestapunk@gmail.com>
 */

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


$accounts = array (
   
'0' => array ('username'=>'username1', 'password'=>'password1'),
   
'1' => array ('username'=>'username2', 'password'=>'password2'),
);
$g = new GmAtom();
foreach (
$accounts as $a) {
   
$g->setLoginInfo ($a['username'], $a['password']);
   
// We need fresh connection for each account, so we supply
    // (bool)true to check() method.
   
$msgCount = $g->check(true);
    if (
false !== $msgCount) {
        echo
$msgCount . ' messages for ' . $g->username . '<br />';
    } else {
        echo
'There has been an error checking "' . $g->username . '" account<br />';
    }
}
?>