-The server is IIS 7.0 (not sure if that matters)
-When ran in a non-class php file there is no error.
-When I comment out the last two lines of the code in the class file there is no error.
-Both the class and non-class files I've been using for testing are in the same directory.
This doesn't make any sense to me, does it to any of you?
Code: Select all
function mymail($to, $from, $subject, $host, $port, $username, $password, $message) {
// This is the Mail.php file from PEAR.
include("Mail.php");
$headers["From"] = $from;
$headers["To"] = $to;
$headers["Subject"] = $subject;
$body = $message;
$params["host"] = $host;
$params["port"] = $port;
$params["auth"] = true;
$params["username"] = $username;
$params["password"] = $password;
// Create the mail object using the Mail::factory method
$mail_object =& Mail::factory("smtp", $params);
$mail_object->send($to, $headers, $body);
}