public boolean sendMessage(ModelMailMessage mailMessage) {
		boolean sentOk = false;

		try (Socket socket = new Socket(smtpName, smtpPort);
				DataOutputStream os = new DataOutputStream(socket.getOutputStream());
				BufferedReader is = new BufferedReader(new InputStreamReader(socket.getInputStream()))) {

			if (smtpUsername != null && smtpPassword != null) {
				writeOut(os, "EHLO ShiraYehezkia AlonLavi\r\n");
				writeOut(os, "AUTH LOGIN\r\n");
				writeOut(os, Base64.encodeBase64String(smtpUsername.getBytes()) + "\r\n");
				writeOut(os, Base64.encodeBase64String(smtpPassword.getBytes()) + "\r\n");
			} else {
				writeOut(os, "HELO ShiraYehezkia AlonLavi\r\n");
			}
			writeOut(os, "MAIL FROM: " + mailMessage.getFrom() + "\r\n");
			writeOut(os, "RCPT TO: " + mailMessage.getTo() + "\r\n");
			writeOut(os, "DATA\r\n");
			writeOut(os, "Subject: " + mailMessage.getSubject() + "\r\n");
			writeOut(os, "From: Mr. Tasker\r\n");
			writeOut(os, "Sender: " + mailMessage.getFrom() + "\r\n");
			writeOut(os, "\r\n");
			writeOut(os, mailMessage.getMessage().replaceAll("[^\r]\n", "\r\n").replaceAll("\r\n.\r\n", "\r\n..\r\n")
					+ "\r\n");
			writeOut(os, ".\r\n");
			writeOut(os, "QUIT\r\n");

			String response;
			while ((response = is.readLine()) != null) {
				logger.debug("Received: " + response);
				if (response.toUpperCase().indexOf("QUEUED") != -1) {
					sentOk = true;
				}
			}

		} catch (IOException | InterruptedException e) {
			sentOk = false;
		}

		if (sentOk) {
			logger.info(String.format("Mail message from: '%s', to: '%s' sent OK.", mailMessage.getFrom(),
					mailMessage.getTo()));
		} else {
			logger.error(String.format("Error while sending mail message from: %s, to: %s", mailMessage.getFrom(),
					mailMessage.getTo()));
		}
		return sentOk;
	}