Using the library

YmailPHP is a Yahoo Mail web service client library. To use it you construct a YMClient
instance and make subsequent method calls that mirror the web service APIs. The following
code snippet will construct a YMClient and use it to print the folder list for a mailbox.

The OAuthToken must be an access token, not a request token. If the access token is stale
then the YmailPHP library will attempt to refresh it.

The YmailPHP library provides some functions that make it easier to create and
manage OAuth sessions with the Ymail web service. The following methods are available
in the YMClient class:

oauth_get_request_token()

oauth_get_access_token()

oauth_get_refreshed_token() - returns an OAuthToken if it was refreshed by the previous call

In addition, it provides some methods to (de-)serialize OAuth tokens to and
from query strings. These query strings are compatible with those generated by
OAuthToken.from_string(), but contain additional data that allows for token refresh, etc.

oauth_token_to_query_string()

oauth_token_from_query_string()

Complete example

Here is a complete working example. It will fetch the list of folders from a mailbox along
with information about the first ten messages. Set your own consumer key, secret and callback
url constants to try it out.