Location: PHPKode > projects > EXtensible Production Suite (XPS) > xpsdev/helpers/xpm3/DOCUMENTATION/examples.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<title>XPM3 Examples</title>
body, pre {
	font-family: Verdana;
	font-size: 10pt;
<body bgcolor="#f1f3f5" topmargin="10" leftmargin="14">

XPM3 <b>Examples</b>
<i>Notice</i>: for more informations, XPM3 package contain a folder "EXAMPLES".

Send an e-mail:
<table border="0" bgcolor="white">
// path to XPM3_MAIL.php from XPM3 package
require_once '/path/XPM3_MAIL.php';

$m = new XPM3_MAIL;
$m->From('hide@address.com'); // From mail address
$m->AddTo('hide@address.com'); // To mail address
$m->Text('It is simple to use XPM3.'); // Body text/plain message
$s = $m->Send('Hello World!'); // Subject message

// print result(s)
if ($s) echo 'Success!'; // if this mail was successfully sent
else print_r($m->result); // if an error occured

Read an e-mail:
<table border="0" bgcolor="white">
// path to XPM3_POP3.php from XPM3 package
require_once '/path/XPM3_POP3.php';

// connect to POP3 mail server with username and password authentication
$conn = XPM3_POP3::Connect('pop.domain.tld', 'username', 'password') or die('Can not connect!');
// get the last mail
$recv = XPM3_POP3::Receive($conn, -1);
// quit and close connection

// print result(s)
if ($recv) print_r($recv); // if last mail was successfully received (read)
else echo 'Can not read!'; // if an error occured or MailBox is empty

<hr color="white">

[ <a style="color: blue; text-decoration: none" href="mailto:hide@address.com?subject=XPM3 Comment Examples">Comments</a> ]

Last update: Thursday, November 30, 2006


Return current item: EXtensible Production Suite (XPS)