title: Create SMTP Client and SMTP Server verify with ssl sertificates (cretaed on oepnssl)
body: <p>I need a help to create the above:
  safe transport of an email between two ends SMTP.I have to create 
  SMTP Client SMTP Server and causality of the certificates to the various entities that 
  need it.  Then I need to send the data from a  file xxxxxx.txt the other side.</p>
  
  <p>I start with this code to create SMTP Client and Server, i am not sure if this is the correct code. (I need to use NetBeans) - ( I create also certificates with openssl )</p>
  
  <p>// Client_Sock.java  code</p>
  
  <pre><code>package client_sock;
  
  import java.io.BufferedReader;
  import java.io.InputStreamReader;
  import java.io.PrintStream;
  import java.net.Socket;
  
  package client_sock;
  
  
  public class Client_Sock {
  
  
  public static void main(String[] args) {
  
      try
  {
     Socket sock =new Socket ("locakhost",9999);
  PrintStream pr = new PrintStream(sock.getOutputStream());
  system.out.print("Ergasia 01 pes 620 20013:");
  InputStreamReader rd = new InputStreamReader (System.in);
  BufferedReader ed = new Bufferedreader(rd);
  
  String temp = ed.readLine();
  
  pr.println(temp);
  
  BufferedReader gt = new BufferedReader(new InputStreamReader(sock.getInputStream()));
  String tm = gt.readLine();
  System.out.print(tm);
  
  
  }
    catch (Exception ex)
  {
  
          }
      }
  }
  </code></pre>
  
  <hr>
  
  <p>//Server_Sock.java  code </p>
  
  <pre><code>package server_sock;
  
  import java.io.BufferedReader;
  import java.io.InputStreamReader;
  import java.io.PrintStream;
  import java.net.ServerSocket;
  import java.net.Socket;
  
  
  public class Server_Sock {
  
  
      public static void main(String[] args) {
  
  try
  {
      ServerSocket ser = new ServerSocket (9999);
      Socket sock = ser.accept();
  
      BufferedReader ed =new BufferedReader (new InputStreamReader(sock.getInputsStream()));
      String tmp = ed.readLine();
      System.out.print("Irecieved:"+tmp);
  
      PrintStream pr = new PrintStream(sock.getOutputStream());
      String str = "The message delivered succesfully !!"
      pr.println(str);
      }
      catch(Exception ex){}
  
      }
  }
  </code></pre>