|
Server : Apache System : Linux s1230 5.15.0-139-generic #149~20.04.1 SMP Tue Jul 14 11:21:49 UTC 2026 x86_64 User : p141464 ( 418825) PHP Version : 7.4.33.12 Disable Function : NONE Directory : /usr/local/pear/test/Mail/tests/ |
Upload File : |
--TEST--
Mail: SMTP Error Reporting
--SKIPIF--
<?php
require_once 'PEAR/Registry.php';
$registry = &new PEAR_Registry();
if (!$registry->packageExists('Net_SMTP')) die("skip\n");
--FILE--
<?php
require_once 'Mail.php';
/* Reference a bogus SMTP server address to guarantee a connection failure. */
$params = array('host' => 'bogus.host.tld');
/* Create our SMTP-based mailer object. */
$mailer = &Mail::factory('smtp', $params);
/* Attempt to send an empty message in order to trigger an error. */
if (PEAR::isError($e = $mailer->send(array(), array(), ''))) {
die($e->getMessage() . "\n");
}
--EXPECT--
Failed to connect to bogus.host.tld:25 [SMTP: Failed to connect socket: (code: -1, response: )]