Hi all,
I installed PEAR yesterday and I think that went ok although although there is only 1 reference to pear in phpinfo which is
include_path has a local value of .;c:wwwphppear
I have downloaded the mail package and I have it under the site root
php root (dir)
[INDENT]PEAR (dir)
[INDENT]Mail.php
Mail (dir)[INDENT]mail.php
null.php
RFC822.php
sendmail.php
smtp.php[/INDENT][/INDENT][/INDENT]
Is this the correct setup? When I run the example script
[code=php]require_once “Mail.php”;
$from = “John Evans<[email protected]>”;
$to = “John Evans<[email protected]>”;
$subject = “Hi!”;
$body = “Hi,nnHow are you?”;
$host = “auth.smtp.1and1.co.uk”;
$username = “john.evans:forcesresources.co.uk”;
$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>”);
}
I get the following
[code=html]Strict Standards: Assigning the return value of new by reference is deprecated in C:wwwphpPEARMail.php on line 154
Strict Standards: Non-static method Mail::factory() should not be called statically in C:wwwwebsiteadmintest.php on line 20
Warning: include_once(Net/SMTP.php) [function.include-once]: failed to open stream: No such file or directory in C:wwwphpPEARMailsmtp.php on line 206
Warning: include_once() [function.include]: Failed opening ‘Net/SMTP.php’ for inclusion (include_path=’.;c:wwwphppear’) in C:wwwphpPEARMailsmtp.php on line 206
Fatal error: Class ‘Net_SMTP’ not found in C:wwwphpPEARMailsmtp.php on line 210
Any help much appreciated as I am desperate to get this problem sorted.