PHP 邮件显示错误 'page is not working'

PHP Mail showing error 'page is not working'

我正在尝试将邮件从 gmail 帐户发送到任何其他电子邮件 但是当我尝试这个页面不工作错误继续显示

我删除了代码的邮件部分,页面工作正常

我的代码:

$from = '<somthing@gmail.com>';
$to = '<anotherthing@gmail.com>';
$subject = 'Hi!';
$body = "How you doooin";

$headers = array(
    'From' => $from,
    'To' => $to,
    'Subject' => $subject
);

$smtp = Mail::factory('smtp', array(
        'host' => 'ssl://smtp.gmail.com',
        'port' => '465',
        'auth' => true,
        'username' => 'something@gmail.com',
        'password' => 'myfrompassword'
    ));

$mail = $smtp->send($to, $headers, $body);

if (PEAR::isError($mail)) {
    echo('<p>' . $mail->getMessage() . '</p>');
} else {
    echo('<p>Message successfully sent!</p>');
}

这出现在我的错误日志中

[05-Nov-2019 13:19:20 UTC] PHP Warning:  ob_start(): function 'callback' not found or invalid function name in /home/arabiancom9/public_html/qrcode/genrator.php on line 26
[05-Nov-2019 13:19:20 UTC] PHP Notice:  ob_start(): failed to create buffer in /home/arabiancom9/public_html/qrcode/genrator.php on line 26
[05-Nov-2019 13:19:20 UTC] PHP Warning:  include_once(Net/SMTP.php): failed to open stream: No such file or directory in /home/arabiancom9/public_html/qrcode/Mail/smtp.php on line 365
[05-Nov-2019 13:19:20 UTC] PHP Warning:  include_once(): Failed opening 'Net/SMTP.php' for inclusion (include_path='.:/opt/alt/php71/usr/share/pear') in /home/arabiancom9/public_html/qrcode/Mail/smtp.php on line 365
[05-Nov-2019 13:19:20 UTC] PHP Fatal error:  Uncaught Error: Class 'Net_SMTP' not found in /home/arabiancom9/public_html/qrcode/Mail/smtp.php:366
Stack trace:
#0 /home/arabiancom9/public_html/qrcode/Mail/smtp.php(271): Mail_smtp->getSMTPObject()
#1 /home/arabiancom9/public_html/qrcode/Mail/smtp.php(258): Mail_smtp->send_or_fail('<ahmedbadreldin...', Array, 'How you doooin')
#2 /home/arabiancom9/public_html/qrcode/genrator.php(103): Mail_smtp->send('<ahmedbadreldin...', Array, 'How you doooin')
#3 {main}
  thrown in /home/arabiancom9/public_html/qrcode/Mail/smtp.php on line 366

如致命错误所述,未找到 Net_SMTP class 我相信您使用的图书馆部分 installed/configure

请检查这些文件:

Net_SMTP

Net_Socket