How to use PHP Swift mail library

We have added this library to all our servers, so now you can use it without having to upload it to the server. Here are the steps to use it:
The library is located in /usr/local/php/Swift and it will kept up to date with new releases.


require_once "Swift/lib/Swift.php";
require_once "Swift/lib/Swift/Connection/NativeMail.php";

$swift = new Swift(new Swift_Connection_NativeMail("-fyou@example.com"));
$message = new Swift_Message("My subject", "My body");

if ($swift->send($message, "recipient@example.com", "you@example.com"))
{
echo "Message sent";
}
else
{
echo "Message failed to send";
}

?>

For more information check out the Swift documentation which is pretty good.