All pastes #92908 Raw Edit

Mine

public text v1 · immutable
#92908 ·published 2006-07-20 00:57 UTC
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;

?>