Package org.subethamail.smtp.client

Examples of org.subethamail.smtp.client.SmartClient.from()


    smtpServer.setPort(0);
    smtpServer.start();
    try
    {
      SmartClient client = new SmartClient("localhost", smtpServer.getPort(), "test-client.example.org");
      client.from("john@exmaple.com");
      client.to("jane@example.org");
      client.quit();
    }
    finally
    {
View Full Code Here


    }

    @Test
    public void testQuit() throws Exception {
        SmartClient smartClient = new SmartClient("localhost", 25, "localhost");
        smartClient.from("");
        smartClient.to("postmaster@example.org");
        smartClient.dataStart();
        byte[] bytes = ExampleMailData.simple().bytes;
        smartClient.dataWrite(bytes, bytes.length);
        smartClient.dataEnd();
View Full Code Here

            e.setRemoteMta(remoteMta);
            throw e;
        }
        try {
            smartClient = clientFactory.create(inetAddress);
            smartClient.from(mail.from.getSmtpText());
            List<RecipientRejection> recipientRejections =
                    new ArrayList<RecipientRejection>();
            List<Recipient> acceptedRecipients = new ArrayList<Recipient>();
            for (Recipient recipient : mail.recipients) {
                try {
View Full Code Here

    @Test
    public void testReceivingAndSending() throws IOException, SMTPException,
            IOException {
        SmartClient client = new SmartClient("localhost", 8025, "SmartClient");
        client.from("john@example.com");
        client.to("jane@example.com");
        client.dataStart();
        byte[] exampleMail = ExampleMailData.simple().bytes;
        client.dataWrite(exampleMail, exampleMail.length);
        client.dataEnd();
View Full Code Here

    private void sendMail() throws UnknownHostException, IOException,
            SMTPException {
        SmartClient client =
                new SmartClient("localhost", PORT_SMTP, "SmartClient");
        client.from("jane@example.com");
        client.to("john@example.com");
        client.dataStart();
        byte[] exampleMail = ExampleMailData.simple().bytes;
        client.dataWrite(exampleMail, exampleMail.length);
        client.dataEnd();
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.