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