2017 © Pedro Peláez
 

library health-checker-check-email

Emails checker for health-checker

image

tonicforhealth/health-checker-check-email

Emails checker for health-checker

  • Thursday, October 27, 2016
  • by drefixs
  • Repository
  • 3 Watchers
  • 0 Stars
  • 8,023 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 9 Versions
  • 6 % Grown

The README.md

health-checker-check-email

License Build Status Scrutinizer Code Quality Code Coverage SensioLabsInsight, (*1)

This is a component for checking email send&receive from smtp service point to imap inbox point., (*2)

## Installation using Composer

$ composer require tonicforhealth/health-checker-check-email

## Requirements

  • PHP 5.5 or higher
  • ext-imap

## Usage

<?php

use PhpImap\Mailbox;
use TonicHealthCheck\Check\Email\Persist\PersistCollectionToFile;
use TonicHealthCheck\Check\Email\Receive\EmailReceiveCheck;
use TonicHealthCheck\Check\Email\Send\EmailSendCheck;

$checkNode = 'testnode';

$persistCollectionToFile = new PersistCollectionToFile(sys_get_temp_dir());

$transport = Swift_SmtpTransport::newInstance();

$mailer = Swift_Mailer::newInstance($transport);

$mailbox = new Mailbox('{imap.gmail.com:993/imap/ssl/novalidate-cert}INBOX', 'username', 'password');

$receiveMaxTime = 300;

$sendInterval = 600;

$emailSendCheck = new EmailSendCheck(
    $checkNode,
    $mailer,
    $persistCollectionToFile,
    'from_test@test.com',
    'to_test@test.com',
    $sendInterval
);

$emailReceiveCheck = new EmailReceiveCheck(
    $checkNode,
    $mailbox,
    $persistCollectionToFile,
    $receiveMaxTime
);

while (true) {
    $resultSend = $emailSendCheck->performCheck();
    printf(
        "Send result is:%s\n",
        $resultSend->isOk() ? 'true' : sprintf('false error:%s', $resultSend->getError()->getMessage())
    );
    sleep(10);
    $resultReceive = $emailReceiveCheck->performCheck();

    printf(
        "Receive result is:%s\n",
        $resultReceive->isOk() ? 'true' : sprintf('false error:%s', $resultReceive->getError()->getMessage())
    );
    sleep(60);
}

The Versions

27/10 2016

dev-master

9999999-dev

Emails checker for health-checker

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dmitry Gopkalo

tonicforhealth health-checker-check-email

27/10 2016

v0.1.6.1

0.1.6.1

Emails checker for health-checker

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dmitry Gopkalo

tonicforhealth health-checker-check-email

09/09 2016

v0.1.6

0.1.6.0

Emails checker for health-checker

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dmitry Gopkalo

tonicforhealth health-checker-check-email

08/04 2016

v0.1.5

0.1.5.0

Emails checker for health-checker

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dmitry Gopkalo

tonicforhealth health-checker-check-email

07/04 2016

v0.1.4

0.1.4.0

Emails checker for health-checker

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dmitry Gopkalo

tonicforhealth health-checker-check-email

04/04 2016

v0.1.3

0.1.3.0

Emails checker for health-checker

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dmitry Gopkalo

tonicforhealth health-checker-check-email

04/04 2016

v0.1.2

0.1.2.0

Emails checker for health-checker

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dmitry Gopkalo

tonicforhealth health-checker-check-email

11/03 2016

v0.1.1

0.1.1.0

Emails checker for health-checker

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dmitry Gopkalo

tonicforhealth health-checker-check-email

09/03 2016

v0.1.0

0.1.0.0

Emails checker for health-checker

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dmitry Gopkalo

tonicforhealth health-checker-check-email