@@ 175-188 (lines=14) @@ | ||
172 | * |
|
173 | * @throws SmtpCheckerException when the SMTP server return error |
|
174 | */ |
|
175 | private function sayHello() |
|
176 | { |
|
177 | $host = $this->getDomainObj()->host; |
|
178 | try{ |
|
179 | $status = $this->commandExec(sprintf("HELO %s", $host)); |
|
180 | if (!in_array(self::SMTP_GENERIC_SUCCESS, $status)) { |
|
181 | $this->disconnect(); |
|
182 | throw new SmtpCheckerException("SMTP Status unexpected: ".implode(",", $status), $this->getDebug()); |
|
183 | } |
|
184 | }catch (\Exception $ex) { |
|
185 | throw new SmtpCheckerException("Error Processing Request ".$ex->getMessage(), $this->getDebug()); |
|
186 | } |
|
187 | ||
188 | } |
|
189 | ||
190 | /** |
|
191 | * Set MAIL FROM to SMTP Server |
|
@@ 197-209 (lines=13) @@ | ||
194 | * |
|
195 | * @throws SmtpCheckerException when the SMTP server return error |
|
196 | */ |
|
197 | private function setFrom() |
|
198 | { |
|
199 | try{ |
|
200 | $status = $this->commandExec(sprintf("MAIL FROM:<%s>", $this->getSender())); |
|
201 | if (!in_array(self::SMTP_GENERIC_SUCCESS, $status)) { |
|
202 | $this->disconnect(); |
|
203 | throw new SmtpCheckerException("SMTP Status unexpected: ".implode(",", $status), $this->getDebug()); |
|
204 | } |
|
205 | }catch (\Exception $ex) { |
|
206 | throw new SmtpCheckerException("Error Processing Request setFrom : ".$ex->getMessage(), $this->getDebug()); |
|
207 | } |
|
208 | ||
209 | } |
|
210 | ||
211 | /** |
|
212 | * Wrapper to Telnet Client to Execute SMTP command, will return the status code |