SSilence / php-imap-client

a easy solution for simple IMAP email access in php
MIT License
269 stars 136 forks source link

Let's try this again #125

Closed hhdivil closed 7 years ago

hhdivil commented 7 years ago

Is the pull request based off the lastest version?

Yeah, I reforked

What features have you added?

What bugs did you fix?

None

Is your code valid PSR-2?

This time, yes!

Have you properly documented your code?

Done a right good job

Has anything in your pull request already been fixed?

No

Anything else?

Could do with writing some tests for this, here's what I'm using for now:

<?php

ini_set('error_reporting', E_ALL);
ini_set('display_errors', 1);

require_once "php-imap-client/ImapClient/ImapClientException.php";
require_once "php-imap-client/ImapClient/ImapConnect.php";
require_once "php-imap-client/ImapClient/ImapClient.php";
require_once "php-imap-client/ImapClient/IncomingMessage.php";
require_once "php-imap-client/ImapClient/IncomingMessageAttachment.php";
require_once "php-imap-client/ImapClient/TypeAttachments.php";
require_once "php-imap-client/ImapClient/TypeBody.php";

use SSilence\ImapClient\ImapClientException;
use SSilence\ImapClient\ImapConnect;
use SSilence\ImapClient\ImapClient;

$server = '';
$user = '';
$pass = '';

$client = new SSilence\ImapClient\ImapClient($server, $user, $pass, SSilence\ImapClient\ImapClient::ENCRYPT_SSL);
$client->selectFolder('FCCC');
$emails = $client->getMessages();

foreach ($emails as $email) {
    foreach ($email->getAttachments() as $attachment) {
        print $attachment->getName() . "\n";
        print $attachment->getBody();
        var_dump($attachment->getRaw());
    }
}
echo 'end';

Optional things below

[] Added your name to the credits [] Add a update name below:

hhdivil commented 7 years ago

This fixes #117

mattparksjr commented 7 years ago

Looks good to me! Thank you for your contributions.