Package jodd.mail.att

Examples of jodd.mail.att.ByteArrayAttachment


   */
  public void addAttachment(String filename, String mimeType, String contentId, byte[] content) {
    if (attachments == null) {
      attachments = new ArrayList<EmailAttachment>();
    }
    EmailAttachment emailAttachment = new ByteArrayAttachment(content, mimeType, filename, contentId);
    emailAttachment.setSize(content.length);
    attachments.add(emailAttachment);
  }
View Full Code Here


    EmailMessage htmlMessage = new EmailMessage(
        "<html><body><h1>Hey!</h1><img src='cid:c.png'></body></html>", MimeTypes.MIME_TEXT_HTML);
    email.addMessage(htmlMessage);

    EmailAttachment embeddedAttachment = new ByteArrayAttachment(new byte[]{1,2,3,4,5,6,7}, "image/png", "c.png", "c.png");
    embeddedAttachment.setEmbeddedMessage(htmlMessage);
    email.attach(embeddedAttachment);

    EmailAttachment attachment = new ByteArrayAttachment(new byte[]{11,12,13,14,15}, "application/zip", "file.zip", "file.zip");
    email.attach(attachment);

    assertEmail(email);
  }
View Full Code Here

   */
  public void addAttachment(String filename, String mimeType, String contentId, byte[] content) {
    if (attachments == null) {
      attachments = new ArrayList<EmailAttachment>();
    }
    EmailAttachment emailAttachment = new ByteArrayAttachment(content, mimeType, filename, contentId);
    emailAttachment.setSize(content.length);
    attachments.add(emailAttachment);
  }
View Full Code Here

  protected ByteArrayAttachment createByteArrayAttachment() {
    String name = this.name;
    String contentType = resolveContentType();
    String contentId = resolveContentId();

    return new ByteArrayAttachment(sourceBytes, contentType, name, contentId);
  }
View Full Code Here

TOP

Related Classes of jodd.mail.att.ByteArrayAttachment

Copyright © 2018 www.massapicom. 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.