use of com.dexels.navajo.adapter.mailmap.AttachementMap in project navajo by Dexels.
the class MailMapAlternative method main.
public static void main(String[] args) throws UserException {
MailMapAlternative mma = new MailMapAlternative();
mma.setMailServer("mail.dexels.com");
mma.setSubject("Test");
mma.setSender("arnoud@dexels.com");
mma.setRecipients("arnoud@dexels.com");
AttachementMap am = new AttachementMap();
am.setAttachFileName("attachment.png");
am.setEncoding("base64");
am.setAttachFile("c:/feyenoord-goud.png");
mma.setAttachment(am);
AttachementMap bm = new AttachementMap();
bm.setAttachFileName("bodypart.png");
bm.setEncoding("base64");
bm.setAttachFile("c:/feyenoord-goud.png");
mma.setRelatedBodyPart(bm);
mma.setContentType("text/html");
mma.setText("<html><head> </head><body>Test<img src=\"cid:attach-nr-0\"></body></html>");
mma.send();
}
use of com.dexels.navajo.adapter.mailmap.AttachementMap in project navajo by Dexels.
the class TestMailResource method testAttach.
@Test
@Ignore
public void testAttach() throws MappableException, UserException {
ResourceMailAdapter rma = new ResourceMailAdapter();
try {
rma.load(new Access());
rma.setRecipients("dexels@gmail.com");
rma.setSender("dexels@gmail.com");
rma.setSubject("Attachment at " + new Date());
AttachementMap am = new AttachementMap();
am.setAttachContentType("image/jpeg");
am.setAttachContentDisposition("inline");
am.setAttachFileContent(new Binary(getClass().getResourceAsStream("monkey.jpeg")));
rma.setAttachment(am);
rma.setResourceName("junit.mail");
rma.store();
} catch (UserException e) {
Assert.assertEquals("javax.mail.AuthenticationFailedException", e.getCause().toString());
}
}
Aggregations