PHP code example of mezon / pop3-client

1. Go to this page and download the library: Download mezon/pop3-client library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mezon / pop3-client example snippets


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

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

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

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

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

	$client->deleteMessage($i);
}

$client->quit();

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

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

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