•   25 July 2007 4:05 pm
  •  
  •  

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 = 'mail_to@domain.mail';

$headers["From"] = 'mail_from@domain.mail';
$headers["To"] = 'mail_to@domain.mail';
$headers["Subject"] = "Test message";

$body = "TEST MESSAGE!!!";

$params["host"] = 'smtp.domainHosted'.com;
$params["port"] = "25";
$params["auth"] = true;
$params["username"] = 'account@domainHosted.com';
$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.

Comments

  Add Comment

Confirm Submission

Please enter the text from the image in the box provided; this helps us to prevent spam.