View Full Version : Testing SMTP server settings

06-21-2006, 09:47 AM
Hello everybody.
I am developing a little system, what verifies every setting option, what user inputs.
So, one thing, what I have to test, is SMTP. Does somebody know a good trick or snippet, how to test SMTP without sending e-mail? :p

06-21-2006, 10:03 AM
What do you need to test?

You can try Swift mailer then print_r() the "transactions" property.

This plugin would prevent it from getting as far as sending mail:

class Swift_Silly_Plugin
public $pluginName = 'silly';
private $swiftInstance;

public function loadBaseObject(&$swiftInstance)
$this->swiftInstance =& $swiftInstance;

public function onBeforeCommand()
if ($this->swiftInstance->responseCode == 354)
die(print_r($this->swiftInstance->transactions, 1));

But in essence you just need to use fsockopen() to write to the server.

You might want to look at fakemail (sourceforge) too. It's saves mail to a file rather than sending it BUT it doesn't support any ESMTP extensions... it's a really basic SMTP only.