Giter Site home page Giter Site logo

zend-timeout-test's Introduction

Zend Mail Timeout Test

This is a test case showing that the Zend Mailer fails when a timeout occurs during the SMTP session.

To run the test case:

  1. Insert mail server config into file mailtest.php
  2. Perform composer install
  3. Run the test case: php mailtest.php

If the server has a timeout of 5 minutes (e.g. smtp.mandrillapp.com does have this timeout), the output will be the following:

Sending first mail...
Sleeping 5 minutes...
5 minutes passed.
Sleeping 10 more seconds...
Sending second mail...
Exception: object(Zend\Mail\Protocol\Exception\RuntimeException)#27 (7) {
  ["message":protected]=>
  string(48) "4.4.2 ip-10-75-138-252 Error: timeout exceeded
  ...
...

To run the test case with the proposed changes, add the following entry to the composer.json.

"repositories": [
	{
		"type": "package",
		"package": {
			"name": "zendframework/zendframework",
			"version": "dev-master",
			"source": {
				"url": "https://github.com/VIISON/zf2.git",
				"type": "git",
				"reference": "master"
			},
			"autoload": {
				"classmap": [""]
			}
		}
	}
]

Delete the composer.lock as well as the vendor directory and run composer install again to switch the source of the Zend framework.

With the proposed changes in place, php mailtest.php succeeds:

Sending first mail...
Sleeping 5 minutes...
5 minutes passed.
Sleeping 10 more seconds...
Sending second mail...
Success!

zend-timeout-test's People

Contributors

andrewisplinghoff avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.