Lines Matching refs:this
15 if (($this->fp = @fsockopen(self::HOST, self::PORT)) === false) {
31 fclose($this->fp);
36 $this->disconnect();
42 fputs($this->fp, "{$tag} {$command}\r\n");
48 while (!feof($this->fp)) {
49 $line = fgets($this->fp);
60 $this->fail("{$tag} timeout");
70 while (!feof($this->fp)) {
71 $line = fgets($this->fp);
73 $this->fail("{$tag} failed");
82 $this->fail("{$tag} failed");
87 $this->fail("{$tag} timeout");
90 $this->fail("{$tag} failed");
116 $this->mailConnecter = MailConnecter::getConnection();
131 $this->mailConnecter->send(self::LOGOUT, 'LOGOUT');
132 if (!$this->mailConnecter->isSuccess(self::LOGOUT)) {
133 $this->mailConnecter->fail('logout failed');
139 $this->mailConnecter->send(self::SELECT_MAILBOX, 'SELECT "INBOX"');
140 if (!$this->mailConnecter->isSuccess(self::SELECT_MAILBOX)) {
141 $this->mailConnecter->fail('select mailbox failed');
144 $this->mailConnecter->send(self::SEARCH, "UID SEARCH SUBJECT \"{$subject}\"");
145 $res = $this->mailConnecter->getResponse(self::SEARCH);
153 fn($uid) => $this->getHeaders($uid) + ['Body' => $this->getBody($uid)],
154 $this->getUidsBySubject($subject),
160 $this->mailConnecter->send(self::FETCH_HEADERS, "UID FETCH {$uid} (BODY[HEADER])");
161 $res = $this->mailConnecter->getResponse(self::FETCH_HEADERS, true);
184 $this->mailConnecter->send(self::FETCH_BODY, "UID FETCH {$uid} (BODY[TEXT])");
185 $body = $this->mailConnecter->getResponse(self::FETCH_BODY, true);
197 … fn($uid) => $this->mailConnecter->send(self::DELETE, "UID STORE {$uid} +FLAGS (\\Deleted)"),
198 $this->getUidsBySubject($subject),
200 $this->mailConnecter->send(self::EXPUNGE, 'EXPUNGE');
212 if (!$this->mailData) {
216 if (!$this->count() > 1) {
220 if ($this->getHeader('From', true) !== $from) {
224 if ($this->getHeader('To', true) !== $to) {
228 if ($this->getHeader('Subject', true) !== $subject) {
232 if (trim($this->getBody()) !== trim($message)) {
242 return count($this->mailData);
248 $mail = array_change_key_case($this->mailData[$offset] ?? []);
251 $mail = $this->mailData[$offset] ?? [];
259 return $this->mailData[$offset]['Body'] ?? null;