<?php
require_once("Mail.php");

$params = array(
  "host" => "xxx.xxx.xx",
  "port" => 587,
  "auth" => true,
  "username" => "xxx@xxx.xxx.xx",
  "password" => "xxxxxxxxxx"
);

$mailObject = Mail::factory("smtp", $params);

$recipients = "xxx@xxx.xxx.xx";
$headers = array(
  "To" => "xxx@xxx.xxx.xx",
  "From" => "xxx@xxx.xxx.xx",
  "Subject" => "Test Mail"
);
$body = "This is test mail";

$mailObject -> send($recipients, $headers, $body);

?>