作者 邓超

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,11 +77,16 @@ class ProxyService @@ -77,11 +77,16 @@ class ProxyService
77 $server->close($fd,true); 77 $server->close($fd,true);
78 return; 78 return;
79 } 79 }
80 - // 请求数据  
81 - self::$clients[$fd]->write($data);  
82 80
  81 + try {
  82 + // 请求数据
  83 + self::$clients[$fd]->write($data);
83 84
84 - $line = self::$clients[$fd]->readLine(); 85 + $line = self::$clients[$fd]->readLine();
  86 +
  87 + }catch (Throwable $e){
  88 + echo date('Y-m-d H:i:s').' 协程读取异常 ' .$data." ::".$e->getMessage()."\n";
  89 + }
85 90
86 // echo 'out '.co::getCid()." => ".$line; 91 // echo 'out '.co::getCid()." => ".$line;
87 92