public static void main(String[] args) throws Exception {
    // CREATE CLIENT INSTANCES
    MailClient redClient = new MailClient("boreas", "localhost");
    MailClient greenClient = new MailClient("green", "localhost");
    MailClient blueClient = new MailClient("blue", "localhost");

    // CLEAR EVERYBODY'S INBOX
    redClient.checkInbox(MailClient.CLEAR_MESSAGES);
    greenClient.checkInbox(MailClient.CLEAR_MESSAGES);
    blueClient.checkInbox(MailClient.CLEAR_MESSAGES);
    Thread.sleep(500); // Let the server catch up

    // SEND A COUPLE OF MESSAGES TO BLUE (FROM RED AND GREEN)
    redClient.sendMessage(
        "*****@*****.**",
        "Good evening",
        "We were working hard, but have confused with configurations((");
    greenClient.sendMessage("blue@localhost", "Testing blue from green", "This is a test message");
    Thread.sleep(50000); // Let the server catch up

    // LIST MESSAGES FOR BLUE (EXPECT MESSAGES FROM RED AND GREEN)
    blueClient.checkInbox(MailClient.SHOW_AND_CLEAR);
  }
示例#2
0
  public static void main(String[] args) throws Exception {
    // CREATE CLIENT INSTANCES
    MailClient myClient = new MailClient("admin", "localhost", true);

    // myClient.checkInbox(MailClient.SHOW_MESSAGES);

    Thread.sleep(500); // Let the server catch up

    myClient.sendMessage("test@localhost", "Testing it is okkk", "This is a test message");
    /*
     * gmaile göndermek için james in adresi ile domain adresi ayný olmasý lazým, yoksa gmail reverse kontrol ile maili almaz.
     */

    Thread.sleep(500); // Let the server catch up

    myClient.checkInbox(MailClient.SHOW_MESSAGES);
  }