I'm trying out the mail pear package. It successfully sends an email but give me the following error:
Strict Standards: Non-static method Mail::factory() should not be called statically, assuming $this from incompatible context in C:Program Files (x86)Apache Software FoundationApache2.2htdocsClientPortalclassesSupportTickets.php on line 356
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in C:PHPPEARMailsmtp.php on line 365
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in C:PHPPEARNetSMTP.php on line 386
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in C:PHPPEARNetSMTP.php on line 391
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in C:PHPPEARNetSMTP.php on line 398
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in C:PHPPEARNetSMTP.php on line 441
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in C:PHPPEARNetSMTP.php on line 230
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in C:PHPPEARNetSMTP.php on line 445
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in C:PHPPEARMailsmtp.php on line 376
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in C:PHPPEARNetSMTP.php on line 526
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in C:PHPPEARNetSMTP.php on line 230
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in C:PHPPEARNetSMTP.php on line 529
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in C:PHPPEARNetSMTP.php on line 532
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in C:PHPPEARNetSMTP.php on line 441
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in C:PHPPEARNetSMTP.php on line 230
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in C:PHPPEARNetSMTP.php on line 445
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in C:PHPPEARNetSMTP.php on line 550
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in C:PHPPEARNetSMTP.php on line 694
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in C:PHPPEARNetSMTP.php on line 230
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in C:PHPPEARNetSMTP.php on line 698
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in C:PHPPEARNetSMTP.php on line 706
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in C:PHPPEARNetSMTP.php on line 230
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in C:PHPPEARNetSMTP.php on line 1017
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in C:PHPPEARNetSMTP.php on line 415
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in C:PHPPEARNetSMTP.php on line 230
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in C:Program Files (x86)Apache Software FoundationApache2.2htdocsClientPortalclassesSupportTickets.php on line 364
Message successfully sent!
Here's my code:
function submitTicket(){
$from = "Billy Jones <billy.jones@networkroi.co.uk>";
$to = "helpdesk <helpdesk@networkroi.co.uk>";
$subject = "Email Test!";
$body = "email test body";
$host = "***";
$username = "***";
$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>");
}
}
Can some one help me out here?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…