The following code block will send an email using the PEAR:mail module.

The code:
<?php

require_once("Mail.php");

$from = "YOUR_COMPANY_NAME <you@domain.com>";
$to = "YOUR_CUSTOMER_NAME <them@domain.net>";
$subject = "PHP email test";
$body = "It works!\n\nDance party time?\n\nI think so.";


$host = "valid_smtp_server_address";
$username = "username";
$password = "password";

$headers = array ('From' => $from,
                  'To' => $to,
                  'Subject' => $subject);
$smtp = Mail::factory('smtp',
        array ('host' => $host,
               'auth' => true,
               'username' => $username,
               'password' => $password));

$mail = $smtp->send($to, $headers, $body);

if (PEAR::isError($mail)) {
	echo("<p>" . $mail->getMessage() . "</p>");
} else {
	echo("<p>Message successfully sent!</p>");
}

?>