public class Main {
    public static void main(String[] args) {

    }
}
@@ -1,69 +1,2475 @@
-public class Main %7B%0A    public static void main(String%5B%5D args) %7B%0A
+import org.apache.commons.cli.*;%0A%0Aimport javax.mail.AuthenticationFailedException;%0Aimport javax.mail.MessagingException;%0Aimport javax.mail.Session;%0Aimport javax.mail.Transport;%0Aimport java.util.Properties;%0A%0Apublic class Main %7B%0A%0A    private static String appName = %22malooer%22;%0A%0A    /**%0A     * Required parameters:%0A     * -port %3CPORT_NUMBER%3E%0A     * -host %3CHOST%3E%0A     * -user %3CUSER%3E%0A     * -pwd %3CPASSWORD%3E%0A     *%0A     * @param args%0A     */%0A    public static void main(String%5B%5D args) %7B%0A        HelpFormatter hFormatter = new HelpFormatter();%0A        CommandLine cl;%0A%0A        if (args.length %3C 1) %7B%0A            hFormatter.printHelp(appName, getOptions());%0A            return;%0A        %7D%0A%0A        try %7B%0A            cl = getCommandline(args);%0A        %7D catch (ParseException e) %7B%0A            hFormatter.printHelp(appName, getOptions());%0A            return;%0A        %7D%0A%0A        Integer port = Integer.valueOf(cl.getOptionValue(%22port%22));%0A        String host = cl.getOptionValue(%22host%22);%0A        String user = cl.getOptionValue(%22user%22);%0A        String pwd = cl.getOptionValue(%22pwd%22);%0A%0A        try %7B%0A            Properties props = new Properties();%0A            props.put(%22mail.smtp.auth%22, %22true%22);%0A%0A            Session session = Session.getInstance(props);%0A%0A            Transport transport = session.getTransport(%22smtp%22);%0A            transport.connect(host, port, user, pwd);%0A            transport.close();%0A            System.out.println(%22Connection established %5B%22 + host + %22%5D%22);%0A        %7D catch (AuthenticationFailedException e) %7B%0A            System.out.println(%22Authentication failed%22);%0A        %7D catch (MessagingException e) %7B%0A            System.out.println(%22Unable to connect to server%22);%0A        %7D%0A    %7D%0A%0A    private static CommandLine getCommandline(String%5B%5D args) throws ParseException %7B%0A        Options options = getOptions();%0A        CommandLineParser clParser = new DefaultParser();%0A%0A        return clParser.parse(options, args);%0A    %7D%0A%0A    private static Options getOptions() %7B%0A        Options options = new Options();%0A%0A        Option portOption = new Option(%22port%22, true, %22port of server%22);%0A        Option hostOption = new Option(%22host%22, true, %22the host%22);%0A        Option userOption = new Option(%22user%22, true, %22the user%22);%0A        Option passOption = new Option(%22pwd%22, true, %22the password%22);%0A%0A        options.addOption(portOption);%0A        options.addOption(hostOption);%0A        options.addOption(userOption);%0A        options.addOption(passOption);%0A%0A        return options;
 %0A   

Establish and close connection to smtp server