Search in sources :

Example 6 with MailMessage

use of com.outjected.email.api.MailMessage in project simple-email by codylerum.

the class InternetAddressTest method validAddresses.

@Test
public void validAddresses() {
    MailMessage m = new MailMessageImpl(TestMailConfigs.standardConfig());
    BasicEmailContact seam = new BasicEmailContact("seam@domain.test");
    BasicEmailContact seamey = new BasicEmailContact("seamey@domain.test");
    Collection<EmailContact> addresses = new ArrayList<EmailContact>();
    addresses.add(seamey);
    m.from("Seam Seamerson<seam@domain.test>");
    m.from("seam@domain.test");
    m.from(seam);
    m.to("seam@domain.test", "Seam Seamerson<seam@domain.test>");
    m.to("Seam Seamerson<seam@domain.test>");
    m.to("seam@domain.test");
    m.to(seam);
    m.to(addresses);
    m.cc("seam@domain.test", "Seam Seamerson<seam@domain.test>");
    m.cc("Seam Seamerson<seam@domain.test>");
    m.cc("seam@domain.test");
    m.cc(seam);
    m.cc(addresses);
    m.bcc("seam@domain.test", "Seam Seamerson<seam@domain.test>");
    m.bcc("Seam Seamerson<seam@domain.test>");
    m.bcc("seam@domain.test");
    m.bcc(seam);
    m.bcc(addresses);
    m.replyTo("Seam Seamerson<seam@domain.test>");
    m.replyTo("seam@domain.test");
    m.replyTo(seam);
}
Also used : MailMessage(com.outjected.email.api.MailMessage) MailMessageImpl(com.outjected.email.impl.MailMessageImpl) EmailContact(com.outjected.email.api.EmailContact) BasicEmailContact(com.outjected.email.impl.BasicEmailContact) ArrayList(java.util.ArrayList) BasicEmailContact(com.outjected.email.impl.BasicEmailContact) Test(org.junit.Test)

Example 7 with MailMessage

use of com.outjected.email.api.MailMessage in project simple-email by codylerum.

the class InternetAddressTest method invalidToFullAddresses.

@Test(expected = InvalidAddressException.class)
public void invalidToFullAddresses() {
    MailMessage m = new MailMessageImpl(TestMailConfigs.standardConfig());
    m.to("foo @bar.com", "Woo");
}
Also used : MailMessage(com.outjected.email.api.MailMessage) MailMessageImpl(com.outjected.email.impl.MailMessageImpl) Test(org.junit.Test)

Example 8 with MailMessage

use of com.outjected.email.api.MailMessage in project simple-email by codylerum.

the class InternetAddressTest method invalidCcSimpleAddresses.

@Test(expected = InvalidAddressException.class)
public void invalidCcSimpleAddresses() {
    MailMessage m = new MailMessageImpl(TestMailConfigs.standardConfig());
    m.cc("woo foo @bar.com");
}
Also used : MailMessage(com.outjected.email.api.MailMessage) MailMessageImpl(com.outjected.email.impl.MailMessageImpl) Test(org.junit.Test)

Example 9 with MailMessage

use of com.outjected.email.api.MailMessage in project simple-email by codylerum.

the class InternetAddressTest method invalidFromFullAddresses.

@Test(expected = InvalidAddressException.class)
public void invalidFromFullAddresses() {
    MailMessage m = new MailMessageImpl(TestMailConfigs.standardConfig());
    m.from("Woo");
}
Also used : MailMessage(com.outjected.email.api.MailMessage) MailMessageImpl(com.outjected.email.impl.MailMessageImpl) Test(org.junit.Test)

Example 10 with MailMessage

use of com.outjected.email.api.MailMessage in project simple-email by codylerum.

the class InternetAddressTest method invalidCcFullAddresses.

@Test(expected = InvalidAddressException.class)
public void invalidCcFullAddresses() {
    MailMessage m = new MailMessageImpl(TestMailConfigs.standardConfig());
    m.cc("foo @bar.com", "Woo");
}
Also used : MailMessage(com.outjected.email.api.MailMessage) MailMessageImpl(com.outjected.email.impl.MailMessageImpl) Test(org.junit.Test)

Aggregations

MailMessage (com.outjected.email.api.MailMessage)13 MailMessageImpl (com.outjected.email.impl.MailMessageImpl)13 Test (org.junit.Test)13 EmailContact (com.outjected.email.api.EmailContact)1 BasicEmailContact (com.outjected.email.impl.BasicEmailContact)1 ArrayList (java.util.ArrayList)1