protected function doHeloCommand()
{
try {
$response = $this->executeCommand(sprintf("EHLO %s\r\n", $this->domain), array(250));
} catch (Swift_TransportException $e) {
return parent::doHeloCommand();
}
if ($this->params['tls']) {
try {
$this->executeCommand("STARTTLS\r\n", array(220));
if (!$this->buffer->startTLS()) {
throw new Swift_TransportException('Unable to connect with TLS encryption');
}
try {
$response = $this->executeCommand(sprintf("EHLO %s\r\n", $this->domain), array(250));
} catch (Swift_TransportException $e) {
return parent::doHeloCommand();
}
} catch (Swift_TransportException $e) {
$this->throwException($e);
}
}
$this->capabilities = $this->getCapabilities($response);
$this->setHandlerParams();
foreach ($this->getActiveHandlers() as $handler) {
$handler->afterEhlo($this);
}
}