Package org.apache.commons.net.smtp

Examples of org.apache.commons.net.smtp.SMTPClient.connect()


            server = new NettyServer(createProtocol(hook));
            server.setListenAddresses(address);
            server.bind();
           
            SMTPClient client = createClient();
            client.connect(address.getAddress().getHostAddress(), address.getPort());
            assertTrue("Reply="+ client.getReplyString(), SMTPReply.isPositiveCompletion(client.getReplyCode()));
           
          
            client.helo("localhost");
            assertTrue("Reply="+ client.getReplyString(), SMTPReply.isPositiveCompletion(client.getReplyCode()));
View Full Code Here


            server = new NettyServer(createProtocol(hook));
            server.setListenAddresses(address);
            server.bind();
           
            SMTPClient client = createClient();
            client.connect(address.getAddress().getHostAddress(), address.getPort());
            assertTrue(SMTPReply.isPositiveCompletion(client.getReplyCode()));
           
            client.helo("localhost");
            assertTrue(SMTPReply.isPositiveCompletion(client.getReplyCode()));
View Full Code Here

            server = new NettyServer(createProtocol(new ProtocolHandler[0]));
            server.setListenAddresses(address);
            server.bind();
           
            SMTPClient client = createClient();
            client.connect(address.getAddress().getHostAddress(), address.getPort());
            assertTrue("Reply="+ client.getReplyString(), SMTPReply.isPositiveCompletion(client.getReplyCode()));
           
          
            client.helo("localhost");
            assertTrue("Reply="+ client.getReplyString(), SMTPReply.isPositiveCompletion(client.getReplyCode()));
View Full Code Here

            server = new NettyServer(createProtocol(hook, testHook));
            server.setListenAddresses(address);
            server.bind();
           
            SMTPClient client = createClient();
            client.connect(address.getAddress().getHostAddress(), address.getPort());
            assertTrue("Reply="+ client.getReplyString(), SMTPReply.isPositiveCompletion(client.getReplyCode()));
           
          
            client.helo("localhost");
            assertTrue("Reply="+ client.getReplyString(), SMTPReply.isPositiveCompletion(client.getReplyCode()));
View Full Code Here

    public void testMaxLineLength() throws Exception {
        finishSetUp(m_testConfiguration);

        SMTPClient smtpProtocol = new SMTPClient();
        smtpProtocol.connect("127.0.0.1", m_smtpListenerPort);
       
        StringBuffer sb = new StringBuffer();
        for (int i = 0; i < AbstractChannelPipelineFactory.MAX_LINE_LENGTH; i++) {
            sb.append("A");
        }
View Full Code Here

    public void testConnectionLimit() throws Exception {
        m_testConfiguration.setConnectionLimit(2);
        finishSetUp(m_testConfiguration);

        SMTPClient smtpProtocol = new SMTPClient();
        smtpProtocol.connect("127.0.0.1", m_smtpListenerPort);
        SMTPClient smtpProtocol2 = new SMTPClient();
        smtpProtocol2.connect("127.0.0.1", m_smtpListenerPort);
       
        SMTPClient smtpProtocol3 = new SMTPClient();
View Full Code Here

        finishSetUp(m_testConfiguration);

        SMTPClient smtpProtocol = new SMTPClient();
        smtpProtocol.connect("127.0.0.1", m_smtpListenerPort);
        SMTPClient smtpProtocol2 = new SMTPClient();
        smtpProtocol2.connect("127.0.0.1", m_smtpListenerPort);
       
        SMTPClient smtpProtocol3 = new SMTPClient();

        try {
            smtpProtocol3.connect("127.0.0.1", m_smtpListenerPort);
View Full Code Here

        smtpProtocol2.connect("127.0.0.1", m_smtpListenerPort);
       
        SMTPClient smtpProtocol3 = new SMTPClient();

        try {
            smtpProtocol3.connect("127.0.0.1", m_smtpListenerPort);
            Thread.sleep(3000);
            fail("Shold disconnect connection 3");
        } catch (Exception e) {
           
        }
View Full Code Here

        smtpProtocol.quit();
        smtpProtocol.disconnect();
        smtpProtocol2.quit();
        smtpProtocol2.disconnect();
       
        smtpProtocol3.connect("127.0.0.1", m_smtpListenerPort);
        Thread.sleep(3000);

      
    }
View Full Code Here

            client = new SMTPClient();
            client.addProtocolCommandListener(new PrintCommandListener(
                                                  new PrintWriter(System.out)));

            client.connect(server);

            if (!SMTPReply.isPositiveCompletion(client.getReplyCode()))
            {
                client.disconnect();
                System.err.println("SMTP server refused connection.");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.