29 error_reporting(E_ALL);
30 define(
'DISPLAY_XPM4_ERRORS',
true);
33 require_once
'../SMTP.php';
35 $f =
'username@gmail.com';
36 $t =
'client@destination.net';
40 $m =
'From: '.$f.
"\r\n".
42 'Subject: test'.
"\r\n".
43 'Content-Type: text/plain'.
"\r\n\r\n".
48 $c = fsockopen(
'tls://smtp.gmail.com', 465, $errno, $errstr, 10) or die($errstr);
50 if (!SMTP::recv(
$c, 220)) die(print_r(
$_RESULT));
52 if (!SMTP::ehlo($c, 'localhost')) SMTP::helo($c, 'localhost') or die(print_r($_RESULT));
54 if (!SMTP::auth($c,
$f,
$p, 'login')) SMTP::auth($c, $f, $p, 'plain') or die(print_r($_RESULT));
56 SMTP::from($c, $f) or die(print_r($_RESULT));
58 SMTP::to($c,
$t) or die(print_r($_RESULT));
60 SMTP::data($c,
$m) or die(print_r($_RESULT));