作者 邓超

phpmailr

@@ -294,6 +294,17 @@ class MailFun { @@ -294,6 +294,17 @@ class MailFun {
294 294
295 } 295 }
296 296
  297 + // 以上全部失败了,再次发送
  298 + $mail->Port = $smtp['port'];
  299 +
  300 + $mail->send_proxy_host = '';
  301 + $mail->Host = $smtp['host'];
  302 +
  303 + // 发送成功直接返回
  304 + if($mail->send()){
  305 + return [true,$mail->getLastMessageID()];
  306 + }
  307 +
297 } 308 }
298 309
299 310
@@ -77,12 +77,17 @@ class ProxyService @@ -77,12 +77,17 @@ class ProxyService
77 $server->close($fd,true); 77 $server->close($fd,true);
78 return; 78 return;
79 } 79 }
  80 +
  81 + try {
80 // 请求数据 82 // 请求数据
81 self::$clients[$fd]->write($data); 83 self::$clients[$fd]->write($data);
82 84
83 -  
84 $line = self::$clients[$fd]->readLine(); 85 $line = self::$clients[$fd]->readLine();
85 86
  87 + }catch (Throwable $e){
  88 + echo date('Y-m-d H:i:s').' 协程读取异常 ' .$data." ::".$e->getMessage()."\n";
  89 + }
  90 +
86 // echo 'out '.co::getCid()." => ".$line; 91 // echo 'out '.co::getCid()." => ".$line;
87 92
88 if($line!==false) $server->send($fd,$line); 93 if($line!==false) $server->send($fd,$line);