This sample uses the Pear Mail package. The package is already in the INCLUDE path.
http://pear.php.net/package/Mail
<?
include_once("Mail.php");
$recipients = '
[email protected]';
$headers["From"] = '
[email protected]';
$headers["To"] = '
[email protected]';
$headers["Subject"] = "Test message";
$body = "TEST MESSAGE!!!";
$params["host"] = 'smtp.domainHosted'.com;
$params["port"] = "25";
$params["auth"] = true;
$params["username"] = '
[email protected]';
$params["password"] = "password";
// Create the mail object using the Mail::factory method
$mail_object =& Mail::factory("smtp", $params);
$mail_object->send($recipients, $headers, $body);
echo "Email sent."
?>
These examples may not work for you without certain modifications.
The purpose of the examples is to give you a general idea on the topic.