Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
--TEST--
2
Net_SMTP: Basic Functionality
3
--FILE--
4
<?php
5
 
6
require_once 'SMTP.php';
7
require_once 'config.php';
8
 
9
if (! ($smtp = new Net_SMTP(TEST_HOSTNAME, TEST_PORT, TEST_LOCALHOST))) {
10
	die("Unable to instantiate Net_SMTP object\n");
11
}
12
 
13
if (PEAR::isError($e = $smtp->connect())) {
14
	die($e->getMessage() . "\n");
15
}
16
 
17
if (PEAR::isError($smtp->mailFrom(TEST_FROM))) {
18
	die('Unable to set sender to <' . TEST_FROM . ">\n");
19
}
20
 
21
if (PEAR::isError($res = $smtp->rcptTo(TEST_TO))) {
22
	die('Unable to add recipient <' . TEST_TO . '>: ' .
23
		$res->getMessage() . "\n");
24
}
25
 
26
if (PEAR::isError($smtp->data(TEST_SUBJECT . "\r\n" . TEST_BODY))) {
27
	die("Unable to send data\n");
28
}
29
 
30
$smtp->disconnect();
31
 
32
echo 'Success!';
33
 
34
--EXPECT--
35
Success!