PHP code example of magium / gmail

1. Go to this page and download the library: Download magium/gmail 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/ */

    

magium / gmail example snippets




$this->emailAddress = '[email protected]';
$this->password     = 'mypassword';




use Magium\AbstractTestCase;
use Magium\Gmail\Actions\Gmail\Login;
use Magium\Gmail\Navigators\Gmail\SubjectContains;

class NavigateToEmailTest extends AbstractTestCase
{

    public function testNavigateToEmailWhereSubjectEquals()
    {
        $this->getAction(Login::ACTION)->login();
        $this->getNavigator(SubjectContains::NAVIGATOR)->navigateTo('magento');
    }

}



use Magium\AbstractTestCase;
use Magium\Gmail\Actions\Gmail\Login;
use Magium\Gmail\Navigators\Gmail\SubjectEquals;

class NavigateToEmailTest extends AbstractTestCase
{

    public function testNavigateToEmailWhereSubjectEquals()
    {
        $this->getAction(Login::ACTION)->login();
        $this->getNavigator(SubjectEquals::NAVIGATOR)->navigateTo('Google Alerts - magento');
    }

}