rendered paste body<?php
$hostname = 'maildomain.net';
// path to smtp.php file from XPM2 package for inclusion
require_once '/path/smtp.php';
$mail = new SMTP;
$mail->Delivery('client');
$mail->From('me@'.$hostname, 'My name');
$mail->FromHost($hostname, $havemx);
if(!$havemx) die("The hostname: '".$hostname."' doesn't have a valid MX zone!");
$mail->AddTo('client@destination.net');
$mail->Text('It is simple to use XPM2');
$sent = $mail->Send('Hello World!');
echo $sent ? 'Success.' : $mail->result;
?>