Git Product home page Git Product logo

fetch's Introduction

Fetch

Fetch is a library for reading email and attachments, primarily using the POP and IMAP protocols.

Fetch was part of a large project, Mortar, which is hosted on Google Code. It is currently being migrated over to Github, as well as being updated to support modern php features. While the project is in flux I encourage you to try it out, but be careful about using it in a production environment without proper testing.

Installation

The most easy way to install the library is via composer. To do so, you have to do the following:

php composer.phar require komex/fetch

Composer will then ask you which version you want to install. Until there are stable versions, by using "@dev" it'll install the latest version.

Sample Usage

This is just a simple code to show how to access messages by using Fetch. It uses Fetch own autoload, but it can (and should be, if applicable) replaced with the one generated by composer.

require 'autoload.php';

$server = new \Fetch\Server('imap.example.com', 993);
$server->setAuthentication('dummy', 'dummy');


$messages = $server->getMessages();
/** @var $message \Fetch\Message */
foreach ($messages as $message) {
    printf(
        "Subject: %s\nFrom: %s\nTo: %s\nBody: %s\n",
        $message->getSubject(),
        $message->getFrom(),
        $message->getAddresses('to', true),
        $message->getMessageBody()
    );
}

fetch's People

Contributors

asm89 avatar bbcvasseur avatar lumbendil avatar sgrodzicki avatar sherblot avatar tedivm 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.