I know it is because I am missing something basic AGAIN!!!!
I get this error:
Fatal error: Class 'Mail' not found in D:\ULEM WebSite\forms\mail.php on line 17
But I swear, when you look in D:\ULEM WebSite\forms\ there is absolutely mail.php and it was part of the pear distribution.
In fact, I have put mail.php just about everywhere now!
I have even tried using the absolute path.
How do I get this script to find what it needs?!?! It is BASIC!!!!!
Code: Select all
<?php
require_once "Mail.php";
$from = "Sandra Sender <sender@example.com>";
$to = "Ramona Recipient <recipient@example.com>";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
$host = "mail.example.com";
$username = "smtp_username";
$password = "smtp_password";
$headers = array ('From' => $from,
'To' => $to,
'Subject' => $subject);
$smtp = Mail::factory('smtp',
array ('host' => $host,
'auth' => true,
'username' => $username,
'password' => $password));
$mail = $smtp->send($to, $headers, $body);
if (PEAR::isError($mail)) {
echo("<p>" . $mail->getMessage() . "</p>");
} else {
echo("<p>Message successfully sent!</p>");
}
?>My head hurts.
I swear, I TRY to figure this stuff out before I ask questions... I really do.
Thanks, and sorry.