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: SMTP Authentication
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($e = $smtp->auth(TEST_AUTH_USER, TEST_AUTH_PASS))) {
18
}
19
 
20
if (PEAR::isError($smtp->mailFrom(TEST_FROM))) {
21
	die('Unable to set sender to <' . TEST_FROM . ">\n");
22
}
23
 
24
if (PEAR::isError($res = $smtp->rcptTo(TEST_TO))) {
25
	die('Unable to add recipient <' . TEST_TO . '>: ' .
26
		$res->getMessage() . "\n");
27
}
28
 
29
if (PEAR::isError($smtp->data(TEST_SUBJECT . "\r\n" . TEST_BODY))) {
30
	die("Unable to send data\n");
31
}
32
 
33
$smtp->disconnect();
34
 
35
echo 'Success!';
36
 
37
--EXPECT--
38
Success!