我正在使用这个repo连接到Gmail。但它的错误。我希望有人有最近的处理经验。
<?php
namespace program;
require_once "php-imap-client/vendor/autoload.php";
use SSilence\ImapClient\ImapClientException;
use SSilence\ImapClient\ImapConnect;
use SSilence\ImapClient\ImapClient as Imap;
$mailbox = 'imap.gmail.com';
$username = '[email protected]';
$password = "wonderland";
$encryption = Imap::ENCRYPT_SSL;
// Open connection
try{
$imap = new Imap($mailbox, $username, $password, $encryption);
// You can also check out example-connect.php for more connection options
}catch (ImapClientException $error){
echo $error->getMessage().PHP_EOL;
die(); // Oh no :( we failed
}