Php mailer代码在xampp1.7.3中工作得很好,但在xampp1.7.7中没有

Php mailer代码在xampp1.7.3中工作得很好,但在xampp1.7.7中没有,php,phpmailer,Php,Phpmailer,以下代码在xampp1.7.3中工作,但在xampp1.7.7中不工作 authentication failure [SMTP: SMTP server does not support authentication (code: 250, response: mx.google.com at your service, [59.92.73.34] SIZE 35882577 8BITMIME STARTTLS ENHANCEDSTATUSCODES)] Strict Standards:

以下代码在xampp1.7.3中工作,但在xampp1.7.7中不工作

authentication failure [SMTP: SMTP server does not support authentication (code: 250, response: mx.google.com at your service, [59.92.73.34] SIZE 35882577 8BITMIME STARTTLS ENHANCEDSTATUSCODES)]


Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in C:\xampp\php\PEAR\Net\SMTP.php on line 491

Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in C:\xampp\php\PEAR\Net\SMTP.php on line 265

Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in C:\xampp\php\PEAR\Net\SMTP.php on line 494

Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in C:\xampp\php\PEAR\Net\SMTP.php on line 497
这是一个邮件程序

<?php
 require_once "Mail.php";
        $from = "username@gmail.com";
        $to = "username@gmail.com";
        $subject = "Hi!";
        $body = "Hi,\n\nHow are you?";
        $host = "smtp.gmail.com";
        $port = "587";
        $username = "username@gmail.com";
        $password = "pwd";
        $headers = array ('From' => $from,
          'To' => $to,
          'Subject' => $subject);
        $smtp =@ Mail::factory('smtp',
          array ('host' => $host,
            'port' => $port,
            '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>");
         }
?>
这个错误会有什么问题,请给出您的建议。


如果我使用端口号465代码添加ssl加密,它会引发一些其他错误


首先,smtp.gmail.com侦听端口465,使用ssl加密,我在您的代码中看不到这一点。如果我添加端口号为465的ssl加密,它会引发一些其他错误。您需要联系主机提供商以了解该错误。
Failed to connect to ssl://smtp.gmail.com:465 [SMTP: Failed to connect socket: Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP? (code: -1, response: )]


Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in C:\xampp\php\PEAR\Net\SMTP.php on line 491

Strict Standards: Non-static method PEAR::getStaticProperty() should not be called statically, assuming $this from incompatible context in C:\xampp\php\PEAR\PEAR.php on line 871

Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in C:\xampp\php\PEAR\Net\SMTP.php on line 265

Strict Standards: Non-static method PEAR::raiseError() should not be called statically, assuming $this from incompatible context in C:\xampp\php\PEAR\Net\SMTP.php on line 267

Strict Standards: Non-static method PEAR::getStaticProperty() should not be called statically, assuming $this from incompatible context in C:\xampp\php\PEAR\PEAR.php on line 871