Skip to content
World Wide Web Server edited this page Jul 4, 2012 · 17 revisions

There is a completely rewritten version of this class at bitbucket now: [url=https://bitbucket.org/sophistry/peeker]peeker[/url]

imap_pop has been superseded! try peeker.


Here's a basic example:

try this out in a controller after dropping the file named imap_pop.php into the libraries dir:

gmail settings example

[code] $this->load->library('imap_pop'); // settings for gmail, you must have // SSL support compiled into PHP // and turn on POP in gmail $config['server']='pop.gmail.com:995'; $config['login']='username@gmail.com'; $config['pass']='password'; $config['service_flags'] = '/pop3/ssl/novalidate-cert'; $config['mailbox']='INBOX'; $connected = $this->imap_pop->connect_and_count($config); if($connected) { $em = $this->imap_pop->grab_email_as_array(1); $this->imap_pop->close(); } print_r($em); [/code]

"normal" pop3 example

[code] $this->load->library('imap_pop'); // this is your pop server host and domain name $config['server']='pop.domain.com:110'; $config['login']='username'; $config['pass']='password'; // you may have to look up the imap functions at PHP.net // to get the right set of service flags here $config['service_flags'] = '/pop3/notls'; $config['mailbox']= 'INBOX'; $connected = $this->imap_pop->connect_and_count($config); if($connected) { $em = $this->imap_pop->grab_email_as_array(1); $this->imap_pop->close(); } print_r($em); [/code]

A version of this class with support for plaintext file attachments (i.e. .html, .php, .txt). Also, contains license terms (X11, the "MIT" license) File:imap_pop_text.php.zip

Category:Contributions::Libraries::E-Mail Category:Libraries::Email Category:Libraries::E-Mail Category:Libraries::E-mail

Clone this wiki locally