public void run ()
    {	Socket s = null;
        try
		{	String res;
	    	s = new Socket(Mailhost, 25);
	    	PrintStream p =
	    		new PrintStream(s.getOutputStream(),true);
	    	in = new DataInputStream(s.getInputStream());
	    	expect("220", "greetings");
	    	p.println("HELO " + "helohost");
	    	expect("250", "helo");
	    	int pos;
		    p.println("MAIL FROM: " + From);
		    expect("250", "mail from");
	    	p.println("RCPT TO: " + To);
		    expect("250", "rcpt to");
		    p.println("DATA");
	    	expect("354", "data");
		    p.println("Subject: " + Subject);
	    	DataInputStream is = new DataInputStream(new StringBufferInputStream(Message));
		    try 
			{	while (true)
				{	String ln = is.readLine();
					if (ln==null) break;
					if (ln.equals("."))
				    ln = "..";
			    	p.println(ln);
			    }
		    }
		    catch (Exception e) {}
			p.println("");
		    p.println(".");
	    	expect("250","end of data");
	    	p.println("QUIT");
		    expect("221", "quit");
		} 
		catch(Exception e)
		{	result = e.getMessage();
			CB.result(false,"Send error!");
    		return;
		}
		finally
		{	try 
			{	if (s != null) s.close();
   			} 
			catch(Exception e)
			{	result = e.getMessage();
			}
		}
		CB.result(true,"Mail sent successfully!");
    }