@Override
	public void connect(final String host, final int port) throws IOException {
		if (heloHost == null) {
			throw new IllegalStateException("Helo host must be specified before connecting");
		}

		super.connect(host, port);
		try {
			this.receiveAndCheck(); // The server announces itself first
			this.sendHeloOrEhlo();
			if (this.authenticator != null) {
				this.authenticator.authenticate();
			}
		} catch (final SMTPException | AuthenticationNotSupportedException e) {
			this.quit();
			throw e;
		} catch (final IOException e) {
			this.close(); // just close the socket, issuing QUIT is hopeless now
			throw e;
		}
	}
Connects to the specified server and issues the initial HELO command. It
gracefully closes the connection if it could be established but subsequently
it fails or if the server does not accept messages.
src/test/java/de/gessnerfl/fakesmtp/smtp/client/SmartClient.java