作者 邓超

添加端口

... ... @@ -60,10 +60,11 @@ class Mail {
public function login($pass_err=true):int {
$this->client = new Imap();
// 处理url
$host = MailFun::getHostPort((!str_contains($this->server, '//')?'':'ssl://').$this->server,993);
try {
// 是否初始成功
$this->client->login("ssl://{$this->server}:993",$this->username,$this->password);
$this->client->login($host['host'].':'.$host['port'],$this->username,$this->password);
}catch (\Throwable $e){
if($pass_err && $e->getCode() == 403){
// 一天中超过 3次失败说明密码错误了
... ...