| 1 |
<div align="center"> |
| 2 |
|
| 3 |
 |
| 4 |
|
| 5 |
# PHP IMAP2 |
| 6 |
|
| 7 |
[](https://github.com/javanile/php-imap2/actions/workflows/linter.yml](https://github.com/javanile/php-imap2/actions/workflows/linter.yml](https://github.com/javanile/php-imap2/actions/workflows/linter.yml) |
| 8 |
|
| 9 |
</div> |
| 10 |
|
| 11 |
## Requirements |
| 12 |
|
| 13 |
- PHP >= 7.0 |
| 14 |
|
| 15 |
## Install |
| 16 |
|
| 17 |
```shell |
| 18 |
composer require javanile/php-imap2 |
| 19 |
``` |
| 20 |
|
| 21 |
or |
| 22 |
|
| 23 |
Download latest release |
| 24 |
|
| 25 |
## Usage |
| 26 |
|
| 27 |
```php |
| 28 |
$mbh = imap2_open($server, $username, $token, OP_XOAUTH2); |
| 29 |
if (! $mbh) { |
| 30 |
error_log(imap2_last_error()); |
| 31 |
throw new \RuntimeException('Unable to open the INBOX'); |
| 32 |
} |
| 33 |
``` |
| 34 |
|
| 35 |
## Gmail OAuth2 |
| 36 |
|
| 37 |
Scope: https://mail.google.com/ |
| 38 |
|
| 39 |
## Sandbox |
| 40 |
|
| 41 |
- Gmail Demo - <https://phpsandbox.io/e/x/zwauf?layout=EditorPreview&defaultPath=%2F&theme=dark&showExplorer=no&openedFiles=> |
| 42 |
- Outlook Demo - **COMING SOON** |
| 43 |
|
| 44 |
|
| 45 |
## Contributors |
| 46 |
|
| 47 |
- [](https://github.com/dicode-nldicode-nl](https://github.com/dicode-nl](https://github.com/dicode-nl) |
| 48 |
- [](https://github.com/glenscglensc](https://github.com/glensc](https://github.com/glensc) |
| 49 |
|
| 50 |
## Other links |
| 51 |
|
| 52 |
- <https://php.libhunt.com/php-imap2-alternatives> |
| 53 |
|
| 54 |
## Reference |
| 55 |
|
| 56 |
### Microsoft Outlook |
| 57 |
|
| 58 |
- <http://wiki.canfigure.net/en/guides/exchange-oauth2> |
| 59 |
|
| 60 |
### IMAP & OAUTH |
| 61 |
|
| 62 |
- <https://www.atmail.com/blog/imap-commands/> |
| 63 |
- <https://developers.google.com/gmail/imap/xoauth2-protocol> |
| 64 |
- <https://github.com/ddeboer/imap/issues/443#issuecomment-1172158902> |
| 65 |
|