-
Notifications
You must be signed in to change notification settings - Fork 460
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Release 2.0 using namespace. See migration notes in README.md
- Loading branch information
Showing
4 changed files
with
36 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,21 +9,28 @@ ImapMailbox is PHP class to access mailbox by POP3/IMAP/NNTP using IMAP extensio | |
* Change email status (see [imap_setflag_full](http://php.net/imap_setflag_full)) | ||
* Delete email | ||
|
||
### [Usage example](https://github.com/barbushin/php-imap/blob/master/example/index.php) | ||
```php | ||
<?php | ||
### Installation by Composer | ||
|
||
{ | ||
"require": { | ||
"php-imap/php-imap": "2.*" | ||
} | ||
} | ||
|
||
### Migration from `v1.*` to `v2.*` | ||
|
||
require_once('../src/ImapMailbox.php'); | ||
Just add following code in the head of your script: | ||
|
||
// IMAP must be enabled in Google Mail Settings | ||
define('GMAIL_EMAIL', '[email protected]'); | ||
define('GMAIL_PASSWORD', '*********'); | ||
define('ATTACHMENTS_DIR', __DIR__); | ||
use PhpImap\Mailbox as ImapMailbox; | ||
use PhpImap\IncomingMail; | ||
use PhpImap\IncomingMailAttachment; | ||
|
||
### [Usage example](https://github.com/barbushin/php-imap/blob/master/example/index.php) | ||
```php | ||
|
||
$mailbox = new ImapMailbox('{imap.gmail.com:993/imap/ssl}INBOX', GMAIL_EMAIL, GMAIL_PASSWORD, ATTACHMENTS_DIR); | ||
$mailbox = new PhpImap\Mailbox('{imap.gmail.com:993/imap/ssl}INBOX', '[email protected]', '*********', __DIR__); | ||
$mails = array(); | ||
|
||
// Get some mail | ||
$mailsIds = $mailbox->searchMailBox('ALL'); | ||
if(!$mailsIds) { | ||
die('Mailbox is empty'); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<?php | ||
<?php namespace PhpImap; | ||
|
||
/** | ||
* @see https://github.com/barbushin/php-imap | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters