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
--SKIPIF--
4
<?php if (!@include('config.php')) die("skip\n");
5
--FILE--
6
<?php
7
 
8
require_once 'Net/SMTP.php';
9
require_once 'config.php';
10
 
11
if (! ($smtp = new Net_SMTP(TEST_HOSTNAME, TEST_PORT, TEST_LOCALHOST))) {
12
	die("Unable to instantiate Net_SMTP object\n");
13
}
14
 
15
if (PEAR::isError($e = $smtp->connect())) {
16
	die($e->getMessage() . "\n");
17
}
18
 
19
if (PEAR::isError($smtp->mailFrom(TEST_FROM))) {
20
	die('Unable to set sender to <' . TEST_FROM . ">\n");
21
}
22
 
23
if (PEAR::isError($res = $smtp->rcptTo(TEST_TO))) {
24
	die('Unable to add recipient <' . TEST_TO . '>: ' .
25
		$res->getMessage() . "\n");
26
}
27
 
28
if (PEAR::isError($smtp->data(TEST_SUBJECT . "\r\n" . TEST_BODY))) {
29
	die("Unable to send data\n");
30
}
31
 
32
$smtp->disconnect();
33
 
34
echo 'Success!';
35
 
36
--EXPECT--
37
Success!