kristiani/email-roundtrip-monitor 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

kristiani/email-roundtrip-monitor

Composer 安装命令:

composer require kristiani/email-roundtrip-monitor

包简介

E-mail Roundtrip monitor package

README 文档

README

Simple PHP email round trip monitoring tool.

Has IMAP support for validating that e-mails are received.

The test e-mails should be sent through the e-mail method that is usual used in your project (passed as a callback function).

Installation

composer require kristiani/email-roundtrip-monitor

Usage

You would like your set-up to consist of two cron jobs

  1. The cron that sends a test e-mail. The cron can be run e.g. every 15 minutes.

  2. The cron that checks the test e-mail is received within an tolerated interval. The cron can be run e.g. every 5 minutes. It's convenient to let a 3rd party service (e.g. uptimerobot.com) pull this check instead of a local cron.

Sending cron

\Roundtripmonitor\Config::$receiverEmail = 'testmailbox@receiver.com';

\Roundtripmonitor\Send::email(function($toName, $toEmail, $fromName, $fromEmail, $subject, $body) {
    yourEmailFunction($toName, $toEmail, $fromName, $fromEmail, $subject, $body);
});

Receiving cron

If you would like your receiving cron to return status code 500 on failure:

\Roundtripmonitor\Config::server('imap.host.com', 143, 'imapUsername', 'imapPassword', 'INBOX');
\Roundtripmonitor\Confirm::emailOrFail();

If you prefer to handle your exceptions by yourself:

try {
    \Roundtripmonitor\Config::server('imap.host.com', 143, 'imapUsername', 'imapPassword', 'INBOX');
    \Roundtripmonitor\Confirm::email();
} catch (\Exception $ex) {
    // do something about it
}

Change settings

You can change all settings in Config.php individually, e.g.

\Roundtripmonitor\Config::$alertThresholdTime = 900;

统计信息

  • 总下载量: 12
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-11-23

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固