package com.e_gineering.simplegmailclient;

public class Main {

    /**
     * @param args
     */
    public static void main(String[] args) {
        SimpleGmailClient client = new SimpleGmailClient();
        String subject = "This is a Test";

        try {
            String username = "{INSERT YOUR USERNAME HERE}";
            String password = "{INSERT YOUR PASSWORD HERE}";

            client.login(username, password);
            client.sendMessage(username + "@gmail.com", subject, "This is some test text");

            // Give the message some time to arrive...
            try {Thread.sleep(10000l);} catch (InterruptedException e) {}

            String message = client.readMessage(subject);
            System.out.println(message);
            client.deleteMessage(subject);

            client.logout();
        } catch (SimpleGmailClientException sgce) {
            sgce.printStackTrace();
        }
    }

}