Coder Social home page Coder Social logo

mezon-pop3-client's Introduction

Mezon POP3 Client

Build Status codecov Scrutinizer Code Quality

Installation

Just type

composer require mezon/pop3-client

Usage

Firts of all you need to connect

$client = new \Mezon\Pop3\Client('ssl://your-email-server', 'login', 'password');

Or in this way:

$client = new \Mezon\Pop3\Client();

// and somewere further
$client->connect('ssl://your-email-server', 'login', 'password');

And then you can fetch necessary information from server. Such as:

client->getCount(); // getting count of emails on the server

Or get headers of the message by it's id, get message's subject or even delete it:

for($i=0; $i<$client->getCount(); $i++) {
	$headers = $client->getMessageHeaders($i);
	$subject = $client->getMessageSubject($i);

	$client->deleteMessage($i);
}

And after all things done you should close connection:

$client->quit();

Utility functions

You can also use more high level functions.

Such as deleting email by it's subject:

$client->deleteMessagesWithSubject('Re: some subject');

Or check if the email with the specified subject exists:

$client->messageWithSubjectExists('Re: some subject');// true or false will be returned

Or parse header wich were fetched by the getMessageHeaders(int $i): string and fetch Message-ID field:

$messageId = \Mezon\Pop3\Client::getMessageId($headers);

mezon-pop3-client's People

Contributors

alexdodonov avatar peter279k avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

mezon-pop3-client's Issues

about mails index

tks for this package

when i use this package

1、get emails count num(i got 7)
2、get email header
when i use 0,i got "unkonw message"
when i use 1,i got the first email

so ,i think the emails index is start from 1?

Need README

As title, it should need README to let developers know how to use.

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.