Search in sources :

Example 1 with BasicEmailContact

use of com.outjected.email.impl.BasicEmailContact 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)

Aggregations

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