GithubHelp home page GithubHelp logo

oadaeh / imap Goto Github PK

View Code? Open in Web Editor NEW

This project forked from prodigy7/imap

0.0 1.0 0.0 140 KB

Simple wrapper class for PHP's IMAP-related email functions.

Home Page: http://www.midwesternmac.com/imap

License: MIT License

PHP 100.00%

imap's Introduction

IMAP for PHP Logo

Imap

A PHP wrapper class for PHP's IMAP-related email handling functions.

This class includes many convenience methods to help take the headache out of dealing with emails in PHP. For example, email handling method names make more sense (e.g. getMessage, deleteMessage, and moveMessage along with a message id, rather than passing around IMAP streams, using many difficult-to-remember imap_* functions).

Also, this class adds some convenient helpful information to emails, like the full message header (in raw_header), and whether or not the email was sent by an autoresponder (see detectAutoresponder for details).

If you have any issues or feature suggestions, please post a new issue on GitHub.

Usage

Connect to an IMAP account by creating a new Imap object with the required parameters:

$host = 'imap.example.com';
$user = 'johndoe';
$pass = '12345';
$port = 993;
$ssl = true;
$folder = 'INBOX';
$mailbox = new Imap($host, $user, $pass, $port, $ssl, $folder);

Get a list of all mailboxes:

$mailbox->getMailboxInfo();

Get an array of message counts (recent, unread, and total):

$mailbox->getCurrentMailboxInfo();

Get an associative array of message ids and subjects:

$mailbox->getMessageIds();

Load details for a message by id.

$id = 2;
$mailbox->getMessage($id);

Delete a message by id.

$id = 2;
$mailbox->deleteMessage($id);

Disconnect from the server (necessary after deleting or moving messages):

$mailbox->disconnect();

More methods and documentation can be found in the Imap.php class file.

License

Imap is licensed under the MIT (Expat) license. See included LICENSE.md.

imap's People

Contributors

geerlingguy avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.