Exemple #1
0
 public function testGetMailItems()
 {
     $client = $this->getClient();
     $mailItems = $client->getMailItems();
     $this->assertCount(0, $mailItems);
     $this->createTestMail();
     $mailItems = $client->getMailItems();
     $this->assertCount(1, $mailItems);
     $mailClient = new MailAPI();
     $mailClient->setClient($client->getClient());
     $mailItems = $client->getMailItems($client->getFolderId());
     $this->assertCount(1, $mailItems);
 }
Exemple #2
0
<?php

require_once "vendor/autoload.php";
use jamesiarmes\PEWS\API\Type;
use jamesiarmes\PEWS\Mail\MailAPI;
$api = MailAPI::withUsernameAndPassword('server', 'username', 'password');
$message = new Type\MessageType();
$message->setBody('Some Text');
$message->setSubject('Test Subject');
$message->setToRecipients('*****@*****.**');
$return = $api->sendMail($message);
Exemple #3
0
 /**
  * @param string $folderName
  * @return MailAPI
  */
 public function getMailbox($folderName = null)
 {
     $mailApi = new MailAPI();
     $mailApi->setClient($this->getClient());
     $mailApi->pickMailFolder($folderName);
     return $mailApi;
 }