PHP Classes
Icontem

File: examples/check_multiple.php


  Search   All class groups All class groups   Latest entries Latest entries   Top 10 charts Top 10 charts   Newsletter Newsletter   Blog Blog   Forums Forums   Help FAQ Help FAQ  
  Login   Register  
Recommend this page to a friend! ReTweet ReTweet Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Ve Bailovity  >  GmAtom  >  examples/check_multiple.php  
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
 

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 />';
    }
}
?>

 
  Advertise on this site Advertise on this site   Site map Site map   Statistics Statistics   Site tips Site tips   Privacy policy Privacy policy   Contact Contact  

For more information send a message to :
info at phpclasses dot org.
Copyright (c) Icontem 1999-2009 PHP Classes - PHP Class Scripts
  PHP Book Reviews - Reviews of books and other products