我试图使用PEAR从PHP应用程序发送电子邮件。电子邮件发送成功,但我得到了以下错误。这是正在使用的代码
include('Mail.php');
include('Mail/mime.php');
$host = "ssl://smtp.gmail.com";
$port = "465";
$username = "test@gmail.com";
$password = "123456";
$to = 'test1@gmail.com';
$from = "TEST <test@gmail.com>";
$replyto = "TEST <test@gmail.com>";
$subject = "TEST";
$name = TEST;
$headers = array('From' => $from, 'To' => $to, 'Subject' => $subject);
$smtp = Mail::factory('smtp', array('host' => $host, 'port' => $port, 'auth' => true, 'username' => $username, 'password' => $password));
$html = "<html>
<head></head>
<body>
<p>Dear " . $name . ",</p>
<p>Test email</p>
</body>
</html>";
$mime_params = array(
'text_encoding' => '7bit',
'text_charset' => 'UTF-8',
'html_charset' => 'UTF-8',
'head_charset' => 'UTF-8'
);
$crlf = "\n";
$mime = new Mail_mime($crlf);
//$body = $mime->get(array('text_charset' => 'utf-8'));
$mime->setHTMLBody($html);
//$mime->addAttachment($file, 'text/plain');
$body = $mime->get($mime_params);
$headers = $mime->headers($headers);
$mail = $smtp->send($to, $headers, $body);
$mail = $smtp->send($bcc, $headers, $body);
if (PEAR::isError($mail)) {
echo("" . $mail->getMessage() . "");
}错误信息
Strict Standards: Assigning the return value of new by reference is deprecated in /usr/share/php/Mail.php on line 154
Strict Standards: Non-static method Mail::factory() should not be called statically in /var/www/qcmc/registration2016/completed.php on line 252
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Mail/smtp.php on line 225
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Net/SMTP.php on line 339
Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /usr/share/php/PEAR.php on line 281
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Net/SMTP.php on line 344
Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /usr/share/php/PEAR.php on line 281
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Net/SMTP.php on line 347
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Net/SMTP.php on line 390
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Net/SMTP.php on line 196
Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /usr/share/php/PEAR.php on line 281
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Net/SMTP.php on line 394
Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /usr/share/php/PEAR.php on line 281
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Mail/smtp.php on line 236
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Net/SMTP.php on line 494
Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /usr/share/php/PEAR.php on line 281
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Net/SMTP.php on line 637
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Net/SMTP.php on line 196
Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /usr/share/php/PEAR.php on line 281
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Net/SMTP.php on line 641
Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /usr/share/php/PEAR.php on line 281
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Net/SMTP.php on line 649
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Net/SMTP.php on line 196
Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /usr/share/php/PEAR.php on line 281
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Net/SMTP.php on line 653
Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /usr/share/php/PEAR.php on line 281
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Net/SMTP.php on line 657
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Net/SMTP.php on line 196
Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /usr/share/php/PEAR.php on line 281
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Net/SMTP.php on line 662
Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /usr/share/php/PEAR.php on line 281
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Net/SMTP.php on line 528
Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /usr/share/php/PEAR.php on line 281
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Mail.php on line 156
Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /usr/share/php/PEAR.php on line 281
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Mail/smtp.php on line 249
Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /usr/share/php/PEAR.php on line 281
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Mail/smtp.php on line 269
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Net/SMTP.php on line 779
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Net/SMTP.php on line 196
Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /usr/share/php/PEAR.php on line 281
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Net/SMTP.php on line 782
Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /usr/share/php/PEAR.php on line 281
Strict Standards: Non-static method Mail_RFC822::parseAddressList() should not be called statically, assuming $this from incompatible context in /usr/share/php/Mail.php on line 221
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Mail.php on line 224
Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /usr/share/php/PEAR.php on line 281
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Mail/smtp.php on line 276
Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /usr/share/php/PEAR.php on line 281
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Mail/smtp.php on line 282
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Net/SMTP.php on line 809
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Net/SMTP.php on line 196
Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /usr/share/php/PEAR.php on line 281
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Net/SMTP.php on line 812
Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /usr/share/php/PEAR.php on line 281
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Mail/smtp.php on line 291
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Net/SMTP.php on line 871
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Net/SMTP.php on line 196
Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /usr/share/php/PEAR.php on line 281
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Net/SMTP.php on line 874
Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /usr/share/php/PEAR.php on line 281
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Net/SMTP.php on line 878
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Net/SMTP.php on line 196
Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /usr/share/php/PEAR.php on line 281
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Net/SMTP.php on line 881
Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /usr/share/php/PEAR.php on line 281
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Net/SMTP.php on line 364
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Net/SMTP.php on line 196
Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /usr/share/php/PEAR.php on line 281
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Net/SMTP.php on line 367
Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /usr/share/php/PEAR.php on line 281
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Net/SMTP.php on line 370
Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /usr/share/php/PEAR.php on line 281
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Mail/smtp.php on line 225
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Net/SMTP.php on line 339
Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /usr/share/php/PEAR.php on line 281
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Net/SMTP.php on line 344
Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /usr/share/php/PEAR.php on line 281
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Net/SMTP.php on line 347
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Net/SMTP.php on line 390
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Net/SMTP.php on line 196
Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /usr/share/php/PEAR.php on line 281
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Net/SMTP.php on line 394
Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /usr/share/php/PEAR.php on line 281
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Mail/smtp.php on line 236
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Net/SMTP.php on line 494
Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /usr/share/php/PEAR.php on line 281
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Net/SMTP.php on line 637
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Net/SMTP.php on line 196
Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /usr/share/php/PEAR.php on line 281
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Net/SMTP.php on line 641
Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /usr/share/php/PEAR.php on line 281
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Net/SMTP.php on line 649
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Net/SMTP.php on line 196
Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /usr/share/php/PEAR.php on line 281
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Net/SMTP.php on line 653
Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /usr/share/php/PEAR.php on line 281
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Net/SMTP.php on line 657
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Net/SMTP.php on line 196
Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /usr/share/php/PEAR.php on line 281
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Net/SMTP.php on line 662
Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /usr/share/php/PEAR.php on line 281
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Net/SMTP.php on line 528
Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /usr/share/php/PEAR.php on line 281
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Mail.php on line 156
Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /usr/share/php/PEAR.php on line 281
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Mail/smtp.php on line 249
Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /usr/share/php/PEAR.php on line 281
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Mail/smtp.php on line 269
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Net/SMTP.php on line 779
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Net/SMTP.php on line 196
Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /usr/share/php/PEAR.php on line 281
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Net/SMTP.php on line 782
Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /usr/share/php/PEAR.php on line 281
Strict Standards: Non-static method Mail_RFC822::parseAddressList() should not be called statically, assuming $this from incompatible context in /usr/share/php/Mail.php on line 221
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Mail.php on line 224
Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /usr/share/php/PEAR.php on line 281
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Mail/smtp.php on line 276
Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /usr/share/php/PEAR.php on line 281
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Mail/smtp.php on line 282
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Net/SMTP.php on line 809
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Net/SMTP.php on line 196
Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /usr/share/php/PEAR.php on line 281
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Net/SMTP.php on line 812
Strict Standards: Non-static method PEAR::raiseError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Net/SMTP.php on line 303
Strict Standards: Non-static method PEAR::getStaticProperty() should not be called statically, assuming $this from incompatible context in /usr/share/php/PEAR.php on line 871
Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /usr/share/php/PEAR.php on line 281
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Net/SMTP.php on line 1015
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Net/SMTP.php on line 196
Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /usr/share/php/PEAR.php on line 281
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Net/SMTP.php on line 1018
Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /usr/share/php/PEAR.php on line 281
Strict Standards: Non-static method PEAR::raiseError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Mail/smtp.php on line 286
Strict Standards: Non-static method PEAR::getStaticProperty() should not be called statically, assuming $this from incompatible context in /usr/share/php/PEAR.php on line 871
Strict Standards: Non-static method PEAR::isError() should not be called statically in /var/www/qcmc/registration2016/completed.php on line 287
Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /usr/share/php/PEAR.php on line 281
Failed to add recipient: @localhost [SMTP: Invalid response code received from server (code: 555, response: 5.5.2 Syntax error. c20sm50575655pfj.47 - gsmtp)]
Warning: Cannot modify header information - headers already sent by (output started at /usr/share/php/Mail.php:154) in /var/www/qcmc/registration2016/completed.php on line 294
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Net/SMTP.php on line 364
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Net/SMTP.php on line 196
Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /usr/share/php/PEAR.php on line 281
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Net/SMTP.php on line 367
Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /usr/share/php/PEAR.php on line 281
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Net/SMTP.php on line 370
Strict Standards: is_a(): Deprecated. Please use the instanceof operator in /usr/share/php/PEAR.php on line 281发布于 2016-05-18 07:01:29
https://stackoverflow.com/questions/34446747
复制相似问题